public class ShortestPathFinder extends java.lang.Object implements PathFinder
Modifier and Type | Class and Description |
---|---|
class |
ShortestPathFinder.Node |
Constructor and Description |
---|
ShortestPathFinder(LineMap map) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(WaypointListener wpl) |
Path |
findRoute(Pose start,
Waypoint finish)
Finds the shortest path from start to finish using the map (or collection
of lines) in the constructor.
|
Path |
findRoute(Pose start,
Waypoint finish,
LineMap theMap)
Finds the shortest path from start to finish using the map ( collection
of lines) in the constructor.
|
int |
getIterationCount() |
java.util.ArrayList<Line> |
getMap() |
int |
getNodeCount() |
boolean |
inCandidateSet(ShortestPathFinder.Node aNode)
helper method for findPath; check if aNode is in the set of candidate
nodes
|
void |
lengthenLines(float delta)
lengthens all the lines in the map by delta at each end
|
void |
setDebug(boolean yes) |
void |
setMap(java.util.ArrayList<Line> theMap) |
void |
setMap(LineMap theMap) |
void |
startPathFinding(Pose start,
Waypoint end) |
public ShortestPathFinder(LineMap map)
public Path findRoute(Pose start, Waypoint finish) throws DestinationUnreachableException
findRoute
in interface PathFinder
start
- the initial robot posefinish
- the final robot locationDestinationUnreachableException
- if, for example, you nave not called setMap();public Path findRoute(Pose start, Waypoint finish, LineMap theMap) throws DestinationUnreachableException
start
- the initial robot posefinish
- the final robot locationtheMap
- the LineMap of obstaclesDestinationUnreachableException
- if, for example, you nave not called setMap();public boolean inCandidateSet(ShortestPathFinder.Node aNode)
aNode
- public void setMap(java.util.ArrayList<Line> theMap)
public void setMap(LineMap theMap)
public void setDebug(boolean yes)
public void lengthenLines(float delta)
delta
- added to each end of each linepublic java.util.ArrayList<Line> getMap()
public int getIterationCount()
public int getNodeCount()
public void addListener(WaypointListener wpl)
addListener
in interface PathFinder
public void startPathFinding(Pose start, Waypoint end)
startPathFinding
in interface PathFinder