WDMSim

wdmsim
Class PhysicalTopology

java.lang.Object
  extended by wdmsim.PhysicalTopology

public class PhysicalTopology
extends java.lang.Object

The physical topology of a network refers to he physical layout of devices on a network, or to the way that the devices on a network are arranged and how they communicate with each other.

Author:
andred

Constructor Summary
PhysicalTopology(org.w3c.dom.Element xml)
          Creates a new PhysicalTopology object.
 
Method Summary
 WDMLink[][] getAdjMatrix()
          Retrives a given PhysicalTopology's adjancency matrix, which contains the links between source and destination nodes.
 WDMLink getLink(int linkid)
          Retrieves a specific link in the PhysicalTopology object, based on its unique identifier.
 WDMLink getLink(int src, int dst)
          Retrieves a specific link in the PhysicalTopology object, based on its source and destination nodes.
 OXC getNode(int id)
          Retrieves a specific node in the PhysicalTopology object.
 int getNumLinks()
          Retrieves the number of links in a given PhysicalTopology.
 int getNumNodes()
          Retrieves the number of nodes in a given PhysicalTopology.
 int getNumWavelengths()
          Retrieves the number of wavelengths in a given PhysicalTopology.
 WeightedGraph getWeightedGraph()
          Returns a weighted graph with vertices, edges and weights representing the physical network nodes, links and weights implemented by this class object.
 boolean hasLink(int node1, int node2)
          Says whether exists or not a link between two given nodes.
 void printXpressInputFile()
           
 java.lang.String toString()
          Prints all nodes and links between them in the PhysicalTopology object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PhysicalTopology

public PhysicalTopology(org.w3c.dom.Element xml)
Creates a new PhysicalTopology object. Takes the XML file containing all the information about the simulation environment and uses it to populate the PhysicalTopology object. The physical topology is basically composed of nodes connected by links, each supporting different wavelengths.

Parameters:
xml - file that contains the simulation environment information
Method Detail

getNumNodes

public int getNumNodes()
Retrieves the number of nodes in a given PhysicalTopology.

Returns:
the value of the PhysicalTopology's nodes attribute

getNumLinks

public int getNumLinks()
Retrieves the number of links in a given PhysicalTopology.

Returns:
number of items in the PhysicalTopology's linkVector attribute

getNumWavelengths

public int getNumWavelengths()
Retrieves the number of wavelengths in a given PhysicalTopology.

Returns:
the value of the PhysicalTopology's wavelengths attribute

getNode

public OXC getNode(int id)
Retrieves a specific node in the PhysicalTopology object.

Parameters:
id - the node's unique identifier
Returns:
specified node from the PhysicalTopology's nodeVector

getLink

public WDMLink getLink(int linkid)
Retrieves a specific link in the PhysicalTopology object, based on its unique identifier.

Parameters:
linkid - the link's unique identifier
Returns:
specified link from the PhysicalTopology's linkVector

getLink

public WDMLink getLink(int src,
                       int dst)
Retrieves a specific link in the PhysicalTopology object, based on its source and destination nodes.

Parameters:
src - the link's source node
dst - the link's destination node
Returns:
the specified link from the PhysicalTopology's adjMatrix

getAdjMatrix

public WDMLink[][] getAdjMatrix()
Retrives a given PhysicalTopology's adjancency matrix, which contains the links between source and destination nodes.

Returns:
the PhysicalTopology's adjMatrix

hasLink

public boolean hasLink(int node1,
                       int node2)
Says whether exists or not a link between two given nodes.

Parameters:
node1 - possible link's source node
node2 - possible link's destination node
Returns:
true if the link exists in the PhysicalTopology's adjMatrix

getWeightedGraph

public WeightedGraph getWeightedGraph()
Returns a weighted graph with vertices, edges and weights representing the physical network nodes, links and weights implemented by this class object.

Returns:
an WeightedGraph class object

printXpressInputFile

public void printXpressInputFile()

toString

public java.lang.String toString()
Prints all nodes and links between them in the PhysicalTopology object.

Overrides:
toString in class java.lang.Object
Returns:
string containing the PhysicalTopology's adjMatrix values

WDMSim