Class DijkstraAlgorithm
- java.lang.Object
-
- ptolemy.domains.atc.kernel.policy2.DijkstraAlgorithm
-
public class DijkstraAlgorithm extends java.lang.Object
Find the shortest path from a source to a destination. For this purpose each edge has a weight. If the destination of this edge is a stormy track the weight is 6. If it is an occupy track, the weight is 5 and if has both conditions, weight is 11. Else the weight of the edge is 1;- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Maryam Bagheri
-
-
Constructor Summary
Constructors Constructor Description DijkstraAlgorithm()
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Token[]
callDijkstra(java.util.Map<java.lang.Integer,ArrayToken> neighbors, java.util.ArrayList<java.lang.Integer> airportsId, int source, int destination, java.util.Map<java.lang.Integer,Token> stormyTracks, java.util.Map<java.lang.Integer,java.lang.Boolean> inTransit)
Call the Dijkstra algorithm.void
execute(Vertex source)
Execute the Dijkstra algorithm.java.util.LinkedList<Vertex>
getPath(Vertex target)
Return the path from the source to the selected target.
-
-
-
Method Detail
-
execute
public void execute(Vertex source)
Execute the Dijkstra algorithm.- Parameters:
source
- The source id.
-
callDijkstra
public Token[] callDijkstra(java.util.Map<java.lang.Integer,ArrayToken> neighbors, java.util.ArrayList<java.lang.Integer> airportsId, int source, int destination, java.util.Map<java.lang.Integer,Token> stormyTracks, java.util.Map<java.lang.Integer,java.lang.Boolean> inTransit)
Call the Dijkstra algorithm.- Parameters:
neighbors
- The map of neighbors.airportsId
- The airportssource
- The sourcedestination
- The destinationstormyTracks
- The map of storm tracks.inTransit
- the map of in transit objects.- Returns:
- an array of tokens
-
-