|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nasa.arc.brahms.vm.rt.ShortestPathAlgorithm
public class ShortestPathAlgorithm
The ShortestPathAlgorithm provides an implementation of Dijkstra's shortest path algorithm. It is used to determine the shortest distance and path between two areas in the geography of a Brahms model.
Nested Class Summary | |
---|---|
class |
ShortestPathAlgorithm.ShortestPath
The ShortestPath specifies the start and end location of the 'traveled' path, the distance of the path and the path taken from the start location to the end location. |
Field Summary | |
---|---|
static long |
INFINITE
The infinite value to indicate the non-existence of a path between nodes |
Constructor Summary | |
---|---|
ShortestPathAlgorithm()
Constructor, creates a new instance of the ShortestPathAlgorithm. |
Method Summary | |
---|---|
ShortestPathAlgorithm.ShortestPath |
getShortestPath(VMAreaCtx start,
VMAreaCtx end)
Determines the shortest path from the specified start location to the specified end location. |
static ShortestPathAlgorithm |
getShortestPathAlgorithm()
Returns Dijkstra's shortest path algorithm used to determine the shortest distance and path from one area to another. |
void |
init(Model model)
Initializes the shortest path algorithm by placing all areas in the geography in a list and creating a distance matrix used by the shortest path algorithm. |
void |
reset()
Resets the shortest path algorithm removing all areas from the list and emptying the distance matrix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long INFINITE
Constructor Detail |
---|
public ShortestPathAlgorithm()
Method Detail |
---|
public static ShortestPathAlgorithm getShortestPathAlgorithm()
public void init(Model model)
model
- the Model containing the areas and paths that are
part of the geography of the model.public final ShortestPathAlgorithm.ShortestPath getShortestPath(VMAreaCtx start, VMAreaCtx end)
start
- the start locationend
- the end location
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |