|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
fr.inria.opengve.bridge.algorithms.StepAlgo<V,E>
fr.inria.opengve.bridge.algorithms.common.shortestPath.ShortestPathWithSingleOrigin<V,E,G>
public abstract class ShortestPathWithSingleOrigin<V,E extends Link<V>,G extends Graph<V,E>>
This class define common datas and methods between
DijkstraAdvanced and
BellmanFord.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class fr.inria.opengve.bridge.algorithms.StepAlgo |
|---|
StepAlgo.StepAlgoMessage, StepAlgo.StepAlgoMessageType |
| Field Summary | |
|---|---|
protected G |
g_
The graph on which is the algorithms is applied. |
protected AbstractScalar |
infiniteDistance
The infinite distance value. |
protected Map |
result
The map where result are stored. |
protected V |
start_
The vertex from which shortest paths are computed. |
static java.lang.String |
VERTEX_DISTANCE
The string which identify the value to consider as the distance on vertex. |
| Constructor Summary | |
|---|---|
ShortestPathWithSingleOrigin(G g,
boolean byStep)
Initialize data structures. |
|
| Method Summary | |
|---|---|
protected abstract Map |
createMap()
This method is used to create a new Map |
protected abstract Path<V,E> |
createPath()
This method is used to create Path |
protected void |
finalize()
|
protected java.lang.Object |
getDistanceContext()
Give the context used to load distance of edges in the map. |
protected Map |
getDistanceMap()
Return the map where distance are stored. |
protected java.lang.String |
getDistanceName()
Give the name used to load distance of edges in the map. |
AbstractScalar |
getDistanceTo(java.lang.Object v)
Give the distance of the shortest path to a given vertex. |
Path<V,E> |
getShortestPathTo(V v)
Returns a shortest path form source to vertex v. |
protected void |
Initialize(AbstractScalar zero)
This methods initialise data structure. |
void |
setDistanceContext(java.lang.Object context)
Set the context used to load distance of edges. |
void |
setDistanceMap(Map m)
Set the map used to load distance of edges. |
void |
setDistanceName(java.lang.String name)
Set the name used to load distance of edges in the map. |
void |
setInfiniteDistance(AbstractScalar max)
Set the value used as infinite distance. |
protected boolean |
updateVerticesDistance(V v1,
V v2,
E edge)
Update the distance of a given vertice v2 with the distance
of vertex v1 plus the distance of the Link
edge if and only if this value is lesser that the initial
one. |
void |
valuateFromSource(V u)
Computes the shortest distances and paths from node u. |
| Methods inherited from class fr.inria.opengve.bridge.algorithms.StepAlgo |
|---|
ends, getDemoMode, getStepMode, isEnded, nextStep, notifyGraphDisplayRequest, notifyGraphDisplayRequest, notifyLabelEdgesRequest, notifyLabelVerticesRequest, pause, run, setPauseMode, setTime, start |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VERTEX_DISTANCE
protected G extends Graph<V,E> g_
protected V start_
protected Map result
protected AbstractScalar infiniteDistance
| Constructor Detail |
|---|
public ShortestPathWithSingleOrigin(G g,
boolean byStep)
g - The graph on which is apply the algorithm.byStep - The stepMode of the algorithm.| Method Detail |
|---|
protected abstract Path<V,E> createPath()
protected abstract Map createMap()
public void valuateFromSource(V u)
u - the vertex source from where computing distancesprotected void Initialize(AbstractScalar zero)
infiniteDistance and 0 for the source.
zero - An AbstractScalar representing 0.
protected boolean updateVerticesDistance(V v1,
V v2,
E edge)
v2 with the distance
of vertex v1 plus the distance of the Link
edge if and only if this value is lesser that the initial
one.
v1 - The first vertex.v2 - The second vertex.edge - The edge.
true if the update is done and false
otherwise.public Path<V,E> getShortestPathTo(V v)
v - the vertex ending the shortest path starting at source vertex.
public AbstractScalar getDistanceTo(java.lang.Object v)
v - The destination vertex.
public void setDistanceMap(Map m)
m - The map used to load distance of edges.protected Map getDistanceMap()
public void setDistanceContext(java.lang.Object context)
null is
given then default context is used.
context - The context used to load distance of edges in the map.protected java.lang.Object getDistanceContext()
null if default context is used.public void setDistanceName(java.lang.String name)
name - The new name used to load distance of edges in the map.protected java.lang.String getDistanceName()
public void setInfiniteDistance(AbstractScalar max)
max - The new infinite distance.
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||