|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.pogamut.Client.GameMapAStarGoal
public class GameMapAStarGoal
Field Summary | |
---|---|
private NavPoint |
goalNode
|
Constructor Summary | |
---|---|
GameMapAStarGoal(NavPoint goalNode)
|
Method Summary | |
---|---|
int |
getEstimatedDistanceToGoal(java.lang.Object node)
This is heuristic function. ! |
int |
getExtraCost(java.lang.Object nodeFrom,
java.lang.Object nodeTo)
Returns extra cost to add to value when trying to go nodeFrom to nodeTo ... of course it can depends only on nodeTo (some special kind of a floor for instance) Don't worry about the edge cost to become negative, A* ensures that that the least cost is 0 (Algorithm can't work over graphs with negative costs.) |
private NavPoint |
getNavPoint(java.lang.Object node)
|
boolean |
isGoalReached(java.lang.Object actualNode)
Returns true, if we've reached the goal ... e.g. actualNode is node we were trying to get to if this function never returns true, A* will run until all nodes are evaluated |
boolean |
isNodeOpened(java.lang.Object node)
list of flags: R_WALK = 1, //walking required R_FLY = 2, //flying required R_SWIM = 4, //swimming required R_JUMP = 8, // jumping required R_DOOR = 16, // doors R_SPECIAL = 32,// movers R_LADDER = 64, // no idea R_PROSCRIBED = 128, // no idea R_FORCED = 256, // no idea R_PLAYERONLY = 512 // no idea |
void |
setCloseList(java.util.Collection closeList)
This is called at the beggining of the A* algorithm to bind the close list to the goal (you may use it check which nodes we've visited, etc... for extra cost for instance). |
void |
setOpenList(java.util.Collection openList)
This is called at the beggining of the A* algorithm to bind the open list to the goal (you may use it check which nodes we've visited, etc... for extra cost for instance). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private NavPoint goalNode
Constructor Detail |
---|
public GameMapAStarGoal(NavPoint goalNode)
Method Detail |
---|
private NavPoint getNavPoint(java.lang.Object node)
public int getEstimatedDistanceToGoal(java.lang.Object node)
AStarGoal
getEstimatedDistanceToGoal
in interface AStarGoal
public int getExtraCost(java.lang.Object nodeFrom, java.lang.Object nodeTo)
AStarGoal
getExtraCost
in interface AStarGoal
public boolean isGoalReached(java.lang.Object actualNode)
AStarGoal
isGoalReached
in interface AStarGoal
public boolean isNodeOpened(java.lang.Object node)
isNodeOpened
in interface AStarGoal
public void setCloseList(java.util.Collection closeList)
AStarGoal
setCloseList
in interface AStarGoal
public void setOpenList(java.util.Collection openList)
AStarGoal
setOpenList
in interface AStarGoal
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |