net.walend.measured
Class JITShortestGEDistances
java.lang.Object
|
+--net.walend.measured.AbstractShortestGEDistances
|
+--net.walend.measured.DijkstraShortestGEDistances
|
+--net.walend.measured.JITShortestGEDistances
- All Implemented Interfaces:
- HasState, java.io.Serializable, ShortestGEDistances
- public class JITShortestGEDistances
- extends DijkstraShortestGEDistances
- implements ShortestGEDistances, java.io.Serializable
JITShortestGEDistances is an implementation of ShortestGEDistances 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
JITShortestGEDistances
public JITShortestGEDistances(IndexedGEDigraph ceDigraph,
GEPathMeter pathMeter)
throws GENegativeWeightCycleException
recalculate
public void recalculate()
throws GENegativeWeightCycleException
- If the digraph is not valid, rediscover the shortest paths.
- Specified by:
recalculate
in interface ShortestGEDistances
- Specified by:
recalculate
in class AbstractShortestGEDistances
GENegativeWeightCycleException
getLength
public int getLength(int from,
int to)
- Specified by:
getLength
in interface ShortestGEDistances
- Overrides:
getLength
in class AbstractShortestGEDistances
Copyright (c) 2001, 2002, David Walend