nl.tudelft.goal.ut2004.floydwarshall
Class SharedFloydWarshallMap

Package class diagram package SharedFloydWarshallMap
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
      extended by cz.cuni.amis.pogamut.base.agent.module.SensorModule<cz.cuni.amis.pogamut.base.agent.IGhostAgent>
          extended by nl.tudelft.goal.ut2004.floydwarshall.SharedFloydWarshallMap
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner<NavPoint>, cz.cuni.amis.pogamut.base.component.IComponent

public class SharedFloydWarshallMap
extends cz.cuni.amis.pogamut.base.agent.module.SensorModule<cz.cuni.amis.pogamut.base.agent.IGhostAgent>
implements cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner<NavPoint>

Wrapper for a FloyWarschallMap shared by multiple agents.

Author:
M.P. Korstanje

Field Summary
protected  int badEdgeFlag
          Prohibited edges.
protected  FloydWarshallMap sharedMap
          Our map
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule
worldView
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
agent, controller, eventBus, log
 
Constructor Summary
SharedFloydWarshallMap(cz.cuni.amis.pogamut.base.agent.IGhostAgent bot)
           
SharedFloydWarshallMap(cz.cuni.amis.pogamut.base.agent.IGhostAgent bot, int badEdgeFlag, Logger log)
           
SharedFloydWarshallMap(cz.cuni.amis.pogamut.base.agent.IGhostAgent bot, Logger log)
           
 
Method Summary
 boolean checkLink(NavPointNeighbourLink edge)
          Checks whether the edge is usable.
protected  void cleanUp()
          Hook where to perform clean up of data structures of the module.
 cz.cuni.amis.pogamut.base.agent.navigation.IPathFuture<NavPoint> computePath(NavPoint from, NavPoint to)
          Returns path between navpoints 'from' -> 'to'.
 float getDistance(NavPoint from, NavPoint to)
          Calculate's distance between two nav points (using pathfinding).
 List<NavPoint> getPath(NavPoint from, NavPoint to)
          Returns path between navpoints 'from' -> 'to'.
 boolean reachable(NavPoint from, NavPoint to)
          Whether navpoint 'to' is reachable from the navpoint 'from'.
 void refreshPathMatrix()
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

badEdgeFlag

protected int badEdgeFlag
Prohibited edges.


sharedMap

protected FloydWarshallMap sharedMap
Our map

Constructor Detail

SharedFloydWarshallMap

public SharedFloydWarshallMap(cz.cuni.amis.pogamut.base.agent.IGhostAgent bot)

SharedFloydWarshallMap

public SharedFloydWarshallMap(cz.cuni.amis.pogamut.base.agent.IGhostAgent bot,
                              Logger log)

SharedFloydWarshallMap

public SharedFloydWarshallMap(cz.cuni.amis.pogamut.base.agent.IGhostAgent bot,
                              int badEdgeFlag,
                              Logger log)
Method Detail

computePath

public cz.cuni.amis.pogamut.base.agent.navigation.IPathFuture<NavPoint> computePath(NavPoint from,
                                                                                    NavPoint to)
Returns path between navpoints 'from' -> 'to'. The path begins with 'from' and ends with 'to'. If such path does not exist, it returns zero-sized path.

Throws exception if object is disabled, see FloydWarshallMap#setEnabled(boolean). Note that the object is enabled by default.

Specified by:
computePath in interface cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner<NavPoint>
Parameters:
from -
to -
Returns:

reachable

public boolean reachable(NavPoint from,
                         NavPoint to)
Whether navpoint 'to' is reachable from the navpoint 'from'.

Throws exception if object is disabled, see FloydWarshallMap#setEnabled(boolean). Note that the object is enabled by default.

Parameters:
from -
to -
Returns:

getDistance

public float getDistance(NavPoint from,
                         NavPoint to)
Calculate's distance between two nav points (using pathfinding).

Throws exception if object is disabled, see FloydWarshallMap#setEnabled(boolean). Note that the object is enabled by default.

Returns:
Distance or POSITIVE_INFINITY if there's no path.

getPath

public List<NavPoint> getPath(NavPoint from,
                              NavPoint to)
Returns path between navpoints 'from' -> 'to'. The path begins with 'from' and ends with 'to'. If such path doesn't exist, returns null.

Throws exception if object is disabled, see FloydWarshallMap#setEnabled(boolean). Note that the object is enabled by default.

Parameters:
from -
to -
Returns:

checkLink

public boolean checkLink(NavPointNeighbourLink edge)
Checks whether the edge is usable.

Parameters:
from - Starting nav point.
edge - NeighNav object representing the edge.
Returns:
boolean

cleanUp

protected void cleanUp()
Hook where to perform clean up of data structures of the module.

Overrides:
cleanUp in class cz.cuni.amis.pogamut.base.agent.module.AgentModule<cz.cuni.amis.pogamut.base.agent.IGhostAgent>

refreshPathMatrix

public void refreshPathMatrix()


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