- All Superinterfaces:
- All Known Subinterfaces:
- All Known Implementing Classes:
- AStarAlgo, AStarSequential
- public interface PathFinder
- extends java.lang.Runnable
The interface implemented by any class that can find the best path between two places on a map.
With this interface, parameters are given during construction.
|Methods inherited from interface java.lang.Runnable
public PathPlaceSet getShortestPath()
- Returns the shortest path of that PathFinder
- - A correctly initialized PathFinder
- a PathPlaceSet object
- Given the current state of the algorithm of the PathFinder, this method will return either a consistent Path or an inconsistent.
If the PathFinder is in thread mode, this method will probably return an inconsistent Path until the PathFinder fires an Event telling registered ojects that a Path has been computed.
If the PathFinder is running in sequential Mode, the user will be hang until the computation is done. This method should then return a consistent Path. As a reminder, you choose thread/sequential mode at the Factory.
public boolean isSequential()
- Returns true if the PathFinder does not run in its own thread
- a boolean true = sequential PathFinder
false = threaded PathFinder
- a boolean value telling the sequential nature of the PathFinder
public PathPlaceSet getShortestPath(PathPlace origin,
- Find the shortest path between two places. Runs in owner's thread
origin - The origin of the Path
dest - The destination of the Path
- Two PathPlace objects. First is the origin, second is the destination
- the shortest PathPlaceSet between those the two PathPlaces given in argument
- Ask the PathFinder to compute a new Path. This method runs in the owner's thread. No side effects on other parts of the PathFinder
With the help of www.sourceforge.net and www.info.ucl.ac.be