net.walend.measured
Class JITShortestCEDistances
java.lang.Object
|
+--net.walend.measured.AbstractShortestCEDistances
|
+--net.walend.measured.DijkstraShortestCEDistances
|
+--net.walend.measured.JITShortestCEDistances
- All Implemented Interfaces:
- HasState, java.io.Serializable, ShortestCEDistances
- public class JITShortestCEDistances
- extends DijkstraShortestCEDistances
- implements ShortestCEDistances, java.io.Serializable
JITShortestCEDistances is an implementation of ShortestCEDistances that uses Dijkstra's algorithm to find the shortest distances just in time. It caches previous results and uses those results to run future calls for new destinations faster. For repeated destinations, it simply returns an existing result.
- Author:
- David Walend dfw1@cornell.edu
- See Also:
- Serialized Form
Method Summary |
int |
getLength(int from,
int to)
|
void |
recalculate()
If the digraph is not valid, rediscover the shortest paths. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
measuredNodes
private boolean[] measuredNodes
JITShortestCEDistances
public JITShortestCEDistances(IndexedCEDigraph ceDigraph,
CEPathMeter pathMeter)
throws CENegativeWeightCycleException
recalculate
public void recalculate()
throws CENegativeWeightCycleException
- If the digraph is not valid, rediscover the shortest paths.
- Specified by:
recalculate
in interface ShortestCEDistances
- Specified by:
recalculate
in class AbstractShortestCEDistances
CENegativeWeightCycleException
getLength
public int getLength(int from,
int to)
- Specified by:
getLength
in interface ShortestCEDistances
- Overrides:
getLength
in class AbstractShortestCEDistances
Copyright (c) 2001, 2002, David Walend