MATES 3.0-rc2

org.mates.sim.network
Class Topology.SingleSourceShortestPathData

java.lang.Object
  extended byorg.mates.sim.network.Topology.SingleSourceShortestPathData
Enclosing class:
Topology

public class Topology.SingleSourceShortestPathData
extends java.lang.Object

Class containing both the distances and routes for the shortest path between one host and all other hosts.

Author:
Evan Sultanik

Constructor Summary
Topology.SingleSourceShortestPathData(double[] distances, int[] predecessors, int source_index)
          Constructs the shortest path information of a source host from a matrix of geodesic distances and a route matrix.
 
Method Summary
 double[] getDistances()
          Returns an n-element array where n == getNumHosts() and entry ith entry corresponds to the distance of the shortest path from host source_index to host i.
 int[] getPredecessors()
          Returns the predecessor array for the shortest paths.
 Host getRoute(Host host)
          Returns the next host in the route from the source host to host.
 int getRoute(int host_index)
          Returns the next host in the route from the source host to the host with index host_index.
 Host getSource()
          Returns the source host for the shortest paths.
 int getSourceIndex()
          Returns the index of the source host for the shortest paths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Topology.SingleSourceShortestPathData

public Topology.SingleSourceShortestPathData(double[] distances,
                                             int[] predecessors,
                                             int source_index)
Constructs the shortest path information of a source host from a matrix of geodesic distances and a route matrix.

Method Detail

getDistances

public double[] getDistances()
Returns an n-element array where n == getNumHosts() and entry ith entry corresponds to the distance of the shortest path from host source_index to host i. These entries may include Double.POSITIVE_INFINITY, if the graph is not connected.


getPredecessors

public int[] getPredecessors()
Returns the predecessor array for the shortest paths.


getRoute

public Host getRoute(Host host)
Returns the next host in the route from the source host to host. If no path exists between the hosts, null is returned.


getRoute

public int getRoute(int host_index)
Returns the next host in the route from the source host to the host with index host_index. If no path exists between the hosts, -1 is returned.


getSource

public Host getSource()
Returns the source host for the shortest paths.


getSourceIndex

public int getSourceIndex()
Returns the index of the source host for the shortest paths.


MATES 3.0-rc2

Submit a bug or request a feature
http://mates.sourceforge.net/

Copyright 2004 Evan Sultanik