Package network

Class Link

java.lang.Object
network.Link

public class Link
extends java.lang.Object
Network Links
  • Field Summary

    Fields
    Modifier and Type Field Description
    (package private) java.lang.Double capacity
    link capacity in Gbps
    (package private) int id
    link ID
    (package private) boolean intrarack
    is it an intra-rack link?
    (package private) int[] linkednodes
    IDs of the nodes connected by the link
    (package private) int linktype
    linktype 0 for bidirectional, 1 input only, 2 output only, -1 for invalid or not operational
    (package private) java.lang.Double load
    traffic load in Gbps
  • Constructor Summary

    Constructors
    Constructor Description
    Link()  
    Link​(int id, int n1, int n2, int type)
    construct Link given id, the nodes it connects and its type
    Link​(int id, int n1, int n2, int type, boolean intr)
    construct Link given id, the nodes it connects, its type and determine whether it is an intra-rack link
  • Method Summary

    Modifier and Type Method Description
    void addload​(java.lang.Double a)
    set current traffic load
    java.lang.Double getavailableband()
    get available bandwidth
    java.lang.Double getcapacity()
    get capacity
    int[] getconnected()
    get the nodes connected by the link
    int getid()
    get link id
    java.lang.Double getload()
    get current traffic load
    int gettype()
    get link type
    boolean isintrarack()
    is it an intra-rack link?
    void remload​(java.lang.Double a)
    remove traffic
    void setcapacity​(java.lang.Double c)
    set capacity
    void setintrarack()
    define this link as intra-rack link
    void settype​(int t)
    set link type

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      int id
      link ID
    • linkednodes

      int[] linkednodes
      IDs of the nodes connected by the link
    • linktype

      int linktype
      linktype 0 for bidirectional, 1 input only, 2 output only, -1 for invalid or not operational
    • intrarack

      boolean intrarack
      is it an intra-rack link?
    • capacity

      java.lang.Double capacity
      link capacity in Gbps
    • load

      java.lang.Double load
      traffic load in Gbps
  • Constructor Details

    • Link

      public Link()
    • Link

      public Link​(int id, int n1, int n2, int type)
      construct Link given id, the nodes it connects and its type
    • Link

      public Link​(int id, int n1, int n2, int type, boolean intr)
      construct Link given id, the nodes it connects, its type and determine whether it is an intra-rack link
  • Method Details

    • getavailableband

      public java.lang.Double getavailableband()
      get available bandwidth
    • settype

      public void settype​(int t)
      set link type
    • setintrarack

      public void setintrarack()
      define this link as intra-rack link
    • isintrarack

      public boolean isintrarack()
      is it an intra-rack link?
    • gettype

      public int gettype()
      get link type
    • setcapacity

      public void setcapacity​(java.lang.Double c)
      set capacity
    • getcapacity

      public java.lang.Double getcapacity()
      get capacity
    • getload

      public java.lang.Double getload()
      get current traffic load
    • addload

      public void addload​(java.lang.Double a)
      set current traffic load
    • remload

      public void remload​(java.lang.Double a)
      remove traffic
    • getid

      public int getid()
      get link id
    • getconnected

      public int[] getconnected()
      get the nodes connected by the link