|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.uni_paderborn.robots.robot.group10.Map.ShortestPath
Class for storing paths created by Map.findShortestPath()
| Field Summary | |
protected int |
distance
The distance to the end of this path. |
protected int |
flags
The flags used to create this path. |
protected MapItemMatcher |
mapItemMatcher
The MapItemMatcher used to create this path. |
protected int |
notVisitedRetries
The number of unsuccessful tries to walk a path containing NOT_VISITED MapItems is counted here. |
protected java.util.LinkedList |
pathToItem
A list of MapItems representing the path. |
protected boolean |
wormholeUsed
Set to true when the roboter has just used a wormhole. |
| Constructor Summary | |
Map.ShortestPath(MapItemMatcher mapItemMatcher,
java.util.LinkedList pathToItem,
int distance,
int flags)
Constructor of a new ShortestPath object |
|
| Method Summary | |
int |
getDistance()
Returns the distance left to the map item which the robot is currently going to using stepToNearestItem().
|
boolean |
isValid()
Checks whether this path is still usable for the robot or he has to search a new path. |
AbstractRobotAction |
nextStep()
Returns the next step on this path. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected java.util.LinkedList pathToItem
protected int distance
protected MapItemMatcher mapItemMatcher
protected int flags
protected boolean wormholeUsed
protected int notVisitedRetries
| Constructor Detail |
public Map.ShortestPath(MapItemMatcher mapItemMatcher,
java.util.LinkedList pathToItem,
int distance,
int flags)
mapItemMatcher - reference to the MapItemMatcherpathToItem - reference to the LinksListdistance - int-value of the distanceflags - {| Method Detail |
public int getDistance()
stepToNearestItem().
This value may by incorrect by 1 because this method does not care about the direction the robot currently has.stepToNearestItem() goes to.public boolean isValid()
public AbstractRobotAction nextStep()
getPathError().
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||