|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--gov.nist.antd.merlin.algorithm.AlgorithmTemplate
|
+--gov.nist.antd.merlin.algorithm.route.shortestpath.distance.ShortestPathDistance
This class implement the shortest path with the Dijkstra's algorithm. The cost is the distance of a link.
This class was developed at the National Institute of Standards and Technology by employees of the Federal Government in the course of their official duties. Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain. NIST assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
| Field Summary | |
private Graph |
graph
The graph of the net |
private double |
requestedBandwidth
The Quality of Service for the path. |
| Fields inherited from class gov.nist.antd.merlin.algorithm.AlgorithmTemplate |
|
| Fields inherited from interface gov.nist.antd.optical.algorithm.Algorithm |
ROUTING, RWA, UNKNOWN, WAVELENGTH |
| Constructor Summary | |
ShortestPathDistance()
Default Constructor |
|
| Method Summary | |
void |
buildPath(Vertex source,
Vertex dest,
java.util.Vector v)
Recursive routine to build path to dest after running shortest path algorithm. |
void |
dijkstra(int startId)
The Dijktra's algorithm. |
java.lang.Object[] |
execute(Glass net,
OpticalConnection[] routes,
java.lang.Object[] parameter)
This method executes the algorithm in the synchronized mode. |
java.util.Vector |
execute(Glass net,
java.util.Vector routes,
java.util.Vector parameter)
This method executes the algorithm. |
private double |
getCost(Edge edge,
int fromHost)
Get the cost of the given edge. |
byte |
getType()
Returns the value of routing algorithms. |
void |
processRequest(OpticalConnection oRoute)
Process a request |
java.lang.String |
toDML()
This method generates the DML representation of this class. |
| Methods inherited from class gov.nist.antd.merlin.algorithm.AlgorithmTemplate |
config, getName, isDebug, setDebug, setName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private Graph graph
private double requestedBandwidth
| Constructor Detail |
public ShortestPathDistance()
| Method Detail |
public void dijkstra(int startId)
startId - the id of the node the diekstra has to start from.
private double getCost(Edge edge,
int fromHost)
edge - The edge.fromHost - The source node
public void buildPath(Vertex source,
Vertex dest,
java.util.Vector v)
source - The source vertex.dest - The destination vertexv - The vector where the path is stored.public void processRequest(OpticalConnection oRoute)
oRoute - The connection Request
public java.util.Vector execute(Glass net,
java.util.Vector routes,
java.util.Vector parameter)
throws AlgorithmException
execute in interface Algorithmexecute in class AlgorithmTemplatenet - The OpNet that contains the topology.routes - The vector containing the OpticalConnection objects. These objects
must not have an owner.parameter - not used by this algorithm.
AlgorithmException - An AlgorithmException occured.
public java.lang.Object[] execute(Glass net,
OpticalConnection[] routes,
java.lang.Object[] parameter)
throws AlgorithmException
execute in interface Algorithmexecute in class AlgorithmTemplatenet - The OpNet that contains the topology.routes - The array of OpticalConnection objects. These objects
must not have an owner.parameter - The array of objects containing the parameters for the
algorithm.
AlgorithmException - An AlgorithmException occured.public java.lang.String toDML()
toDML in interface DMLDumptoDML in class AlgorithmTemplatepublic byte getType()
getType in interface AlgorithmgetType in class AlgorithmTemplate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||