cz.cuni.amis.pogamut.ut2004.agent.navigation.astar
Class UT2004AStarGoal

Package class diagram package UT2004AStarGoal
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.astar.UT2004AStarGoal
All Implemented Interfaces:
cz.cuni.amis.utils.astar.AStarEvaluator<NavPoint>, cz.cuni.amis.utils.astar.AStarGoal<NavPoint>, cz.cuni.amis.utils.astar.AStarHeuristic<NavPoint>
Direct Known Subclasses:
UT2004AStarGoalNavPoint

public abstract class UT2004AStarGoal
extends Object
implements cz.cuni.amis.utils.astar.AStarGoal<NavPoint>


Field Summary
protected  Collection<NavPoint> closeList
           
protected  Collection<NavPoint> openList
           
 
Constructor Summary
UT2004AStarGoal()
           
 
Method Summary
 Collection<NavPoint> getCloseList()
           
abstract  int getEstimatedDistanceToGoal(NavPoint node)
          Method defining "heuristic" for A*, see AStarHeuristic.getEstimatedDistanceToGoal(Object).
 int getExtraCost(NavPoint nodeFrom, NavPoint nodeTo)
          Method defining extra-edge cost, see AStarEvaluator.getExtraCost(Object, Object).
 Collection<NavPoint> getOpenList()
           
abstract  boolean isGoalReached(NavPoint actualNode)
          This tests whether 'actualNode' matches your desired 'goalNode'.
 boolean isNodeOpened(NavPoint node)
          Method defining which nodes are allowed to be explored and which are forbidden, see AStarEvaluator.isNodeOpened(Object).
 void setCloseList(Collection<NavPoint> closeList)
           
 void setOpenList(Collection<NavPoint> openList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

closeList

protected Collection<NavPoint> closeList

openList

protected Collection<NavPoint> openList
Constructor Detail

UT2004AStarGoal

public UT2004AStarGoal()
Method Detail

setCloseList

public void setCloseList(Collection<NavPoint> closeList)
Specified by:
setCloseList in interface cz.cuni.amis.utils.astar.AStarGoal<NavPoint>

setOpenList

public void setOpenList(Collection<NavPoint> openList)
Specified by:
setOpenList in interface cz.cuni.amis.utils.astar.AStarGoal<NavPoint>

getCloseList

public Collection<NavPoint> getCloseList()

getOpenList

public Collection<NavPoint> getOpenList()

getExtraCost

public int getExtraCost(NavPoint nodeFrom,
                        NavPoint nodeTo)
Method defining extra-edge cost, see AStarEvaluator.getExtraCost(Object, Object). You probably won't need to use that, thus it is not abstract.

Returns: always 0

Specified by:
getExtraCost in interface cz.cuni.amis.utils.astar.AStarEvaluator<NavPoint>

isNodeOpened

public boolean isNodeOpened(NavPoint node)
Method defining which nodes are allowed to be explored and which are forbidden, see AStarEvaluator.isNodeOpened(Object). You probably won't need to use that, thus it is not abstract.

Returns: always 0

Specified by:
isNodeOpened in interface cz.cuni.amis.utils.astar.AStarEvaluator<NavPoint>

getEstimatedDistanceToGoal

public abstract int getEstimatedDistanceToGoal(NavPoint node)
Method defining "heuristic" for A*, see AStarHeuristic.getEstimatedDistanceToGoal(Object). You will usually want to return Euclidian distance between 'node' and your goal using NavPoint.getLocation() and Location.getDistance(Location). See also UT2004AStarGoalNavPoint.

Specified by:
getEstimatedDistanceToGoal in interface cz.cuni.amis.utils.astar.AStarHeuristic<NavPoint>
Parameters:
node -

isGoalReached

public abstract boolean isGoalReached(NavPoint actualNode)
This tests whether 'actualNode' matches your desired 'goalNode'. You will usually use "==" to do that as every NavPoint is "sort-of" singleton for single agent (note that every agent has different one, so you might want to equals their ids via NavPoint.getId()).

Specified by:
isGoalReached in interface cz.cuni.amis.utils.astar.AStarGoal<NavPoint>
Parameters:
actualNode -


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.