/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 0 - 2 0 2 0 , ĠD ani lo ĠP ian ini Ġand Ġcontributors Ċ Ġ* Ġlisted Ġin Ġthe Ġmain Ġproject 's Ġal che mist / build . gradle . k ts Ġfile . Ċ Ġ* Ċ Ġ* ĠThis Ġfile Ġis Ġpart Ġof ĠAl che mist , Ġand Ġis Ġdistributed Ġunder Ġthe Ġterms Ġof Ġthe Ċ Ġ* ĠGNU ĠGeneral ĠPublic ĠLicense , Ġwith Ġa Ġlinking Ġexception , Ċ Ġ* Ġas Ġdescribed Ġin Ġthe Ġfile ĠLICENSE Ġin Ġthe ĠAl che mist Ġdistribution 's Ġtop Ġdirectory . Ċ Ġ*/ Ċ Ċ package Ġit . uni bo . al che mist . model . implement ations . actions . navigation str ategies Ċ Ċ import Ġit . uni bo . al che mist . model . implement ations . positions . E uclidean 2 D Position Ċ import Ġit . uni bo . al che mist . model . interfaces . Navigation Action 2 D Ċ import Ġit . uni bo . al che mist . model . interfaces . Navigation Strategy Ċ import Ġit . uni bo . al che mist . model . interfaces . geometry . e uclidean 2 d . Convex Polygon Ċ import Ġit . uni bo . al che mist . model . interfaces . geometry . e uclidean 2 d . E uclidean 2 D Convex Shape Ċ import Ġit . uni bo . al che mist . model . interfaces . geometry . e uclidean 2 d . graph . E uclidean 2 D Pass age Ċ Ċ /** Ċ Ġ* ĠA Ġ[ Navigation Strategy ] Ġallowing Ġto Ġreach Ġa Ġ( static ) Ġdestination . Ċ Ġ* ĠThe Ġclient Ġcan Ġspecify Ġa Ġlist Ġof Ġ[ known Dest inations ] Ġ( see Ġ[ P urs uing ]) Ġand Ġ[ unknown Dest inations ] Ġ( see Ċ Ġ* Ġ[ Goal Oriented Ex plor ing ]). Ċ Ġ* ĠThe Ġpe de stri an Ġwill Ġtry Ġto Ġreach Ġthe Ġclosest Ġknown Ġdestination Ġfor Ġwhich Ġa Ġvalid Ġpath Ġleading Ġthere Ġis Ċ Ġ* Ġknown , Ġbut Ġin Ġcase Ġanother Ġdestination Ġis Ġfound Ġalong Ġthe Ġway Ġ( either Ġknown Ġor Ġunknown ), Ġthe Ġlatter Ġwill Ċ Ġ* Ġbe Ġappro ached Ġinstead Ġof Ġthe Ġchosen Ġknown Ġdestination . ĠTo Ġput Ġit Ġin Ġanother Ġway , Ġthis Ġbehavior Ġmix es Ċ Ġ* Ġ[ Known Destination Re aching ] Ġand Ġ[ Goal Oriented Ex plor ing ]. Ċ Ġ* Ċ Ġ* Ġ@ param ĠT Ġthe Ġconcent ration Ġtype . Ċ Ġ* Ġ@ param ĠL Ġthe Ġtype Ġof Ġland marks Ġof Ġthe Ġpe de stri an 's Ġc ognitive Ġmap . Ċ Ġ* Ġ@ param ĠR Ġthe Ġtype Ġof Ġedges Ġof Ġthe Ġpe de stri an 's Ġc ognitive Ġmap , Ġrepresenting Ġthe Ġ[ R ] el ations Ġbetween Ġland marks . Ċ Ġ*/ Ċ open Ġclass ĠDestination Re aching < T , ĠL Ġ: ĠE uclidean 2 D Convex Shape , ĠR >( ĊĠĠĠ Ġaction : ĠNavigation Action 2 D < T , ĠL , ĠR , ĠConv ex Polygon , ĠE uclidean 2 D Pass age >, ĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠKnown Ġdest inations , Ġcan Ġbe Ġempty . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġprivate Ġval Ġknown Dest inations : ĠList < E uclidean 2 D Position >, ĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠUnknown Ġdest inations , Ġdefaults Ġto Ġan Ġempty Ġlist . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġprivate Ġval Ġunknown Dest inations : ĠList < E uclidean 2 D Position > Ġ= Ġempty List () Ċ ) Ġ: ĠGoal Oriented Ex plor ing < T , ĠL , ĠR > Ġ( ĊĠĠĠ Ġaction , ĊĠĠĠ Ġ/* ĊĠĠĠĠ Ġ* ĠThis Ġmay Ġseem Ġstrange , Ġbut Ġas Ġstated Ġabove Ġif Ġwe Ġfound Ġa Ġdestination Ġalong Ġthe Ġway Ġ( either Ġknown ĊĠĠĠĠ Ġ* Ġor Ġunknown ), Ġwe Ġwant Ġto Ġapproach Ġit Ġand Ġleave Ġthe Ġroute Ġwe 're Ġfollowing . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġknown Dest inations Ġ+ Ġunknown Dest inations Ċ ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġknown Destination Re aching : ĠKnown Destination Re aching < T , ĠL , ĠR >? Ġ= ĊĠĠĠĠĠĠĠ Ġknown Dest inations . take If Ġ{ Ġit . isNotEmpty () Ġ} ?. let Ġ{ ĠKnown Destination Re aching ( action , Ġit ) Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġin New Room ( new Room : ĠConv ex Polygon ) Ġ= Ġwhen Ġ( known Destination Re aching ) Ġ{ ĊĠĠĠĠĠĠĠ Ġnull Ġ-> Ġsuper . in New Room ( new Room ) ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġreach Unknown Destination ( new Room , Ġor Else Ġ= Ġ{ Ġknown Destination Re aching . in New Room ( new Room ) Ġ}) ĊĠĠĠ Ġ} Ċ } Ċ