cad.simcad.objectserver.spec.pathfinding
Interface PathFinder

All Superinterfaces:
java.lang.Runnable
All Known Subinterfaces:
APSSPathFinder
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.

Version:
1.0
Author:
Charles-Philip

Method Summary
 PathPlaceSet getShortestPath()
          Returns the shortest path of that PathFinder
 PathPlaceSet getShortestPath(PathPlace origin, PathPlace dest, PathUser pu)
          Find the shortest path between two places.
 boolean isSequential()
          Returns true if the PathFinder does not run in its own thread
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getShortestPath

public PathPlaceSet getShortestPath()
Returns the shortest path of that PathFinder

Pre:
- A correctly initialized PathFinder
Returns:
a PathPlaceSet object
Post:
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.

isSequential

public boolean isSequential()
Returns true if the PathFinder does not run in its own thread

Pre:
-
Returns:
a boolean true = sequential PathFinder false = threaded PathFinder
Post:
a boolean value telling the sequential nature of the PathFinder

getShortestPath

public PathPlaceSet getShortestPath(PathPlace origin,
                                    PathPlace dest,
                                    PathUser pu)
Find the shortest path between two places. Runs in owner's thread

Parameters:
origin - The origin of the Path
dest - The destination of the Path
Pre:
Two PathPlace objects. First is the origin, second is the destination
Returns:
the shortest PathPlaceSet between those the two PathPlaces given in argument
Post:
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

Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be