Package ons

Class PhysicalTopology

java.lang.Object
ons.PhysicalTopology
Direct Known Subclasses:
EONPhysicalTopology, WDMPhysicalTopology

public abstract 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.
  • Field Details

  • Constructor Details

    • 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
    • PhysicalTopology

      public PhysicalTopology()
  • Method Details

    • getTopologyName

      public java.lang.String getTopologyName()
      Retrieves the topology name.
      Returns:
      the string topology name
    • getNumNodes

      public int getNumNodes()
      Retrieves the number of nodes in a given PhysicalTopology.
      Returns:
      the value of the PhysicalTopology's nodes attribute
    • getSpanSize

      public int getSpanSize()
    • getNumLinks

      public int getNumLinks()
      Retrieves the number of links in a given PhysicalTopology.
      Returns:
      number of items in the PhysicalTopology's linkVector 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
    • getAllFreeGroomingInputPorts

      public int getAllFreeGroomingInputPorts()
      Retrives the all free grooming input ports from all nodes
      Returns:
      the number of grooming input ports from all nodes
    • getLink

      public Link 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 Link 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 Link[][] 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
    • checkLinkPath

      public boolean checkLinkPath​(int[] links)
      Checks if a path made of links makes sense by checking its continuity
      Parameters:
      links - to be checked
      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
    • getTransponderGraph

      public WeightedGraph getTransponderGraph()
      Returns the weighted graph with the representation of transponders [Tx/Rx] available in OXC. Only node, without edges
      Returns:
      the WeightedGraph
    • printXpressInputFile

      public void printXpressInputFile()
    • getDatacentersGroup

      protected DatacenterGroup[] getDatacentersGroup()
      Retrieves all Datacenters Groups in this Topology
      Returns:
      all DatacentersGroup objects
    • getDatacenterGroup

      protected DatacenterGroup getDatacenterGroup​(int index)
      Retrieves a especific Datacenters Group in this Topology
      Returns:
      the DatacentersGroup object
    • 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
    • createPhysicalLightpath

      public abstract void createPhysicalLightpath​(LightPath lp)
    • removePhysicalLightpath

      public abstract void removePhysicalLightpath​(LightPath lp)
    • canCreatePhysicalLightpath

      public abstract boolean canCreatePhysicalLightpath​(LightPath lp)
    • getBW

      public abstract int getBW​(LightPath lp)
    • getBWAvailable

      public abstract int getBWAvailable​(LightPath lp)
    • canAddRate

      public abstract boolean canAddRate​(int rate, LightPath lightpath)
    • addRate

      public abstract void addRate​(int rate, LightPath lightpath)
    • removeRate

      public abstract void removeRate​(int rate, LightPath lightpath)