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.Doublecapacitylink capacity in Gbps(package private) intidlink ID(package private) booleanintrarackis it an intra-rack link?(package private) int[]linkednodesIDs of the nodes connected by the link(package private) intlinktypelinktype 0 for bidirectional, 1 input only, 2 output only, -1 for invalid or not operational(package private) java.lang.Doubleloadtraffic 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 typeLink(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 voidaddload(java.lang.Double a)set current traffic loadjava.lang.Doublegetavailableband()get available bandwidthjava.lang.Doublegetcapacity()get capacityint[]getconnected()get the nodes connected by the linkintgetid()get link idjava.lang.Doublegetload()get current traffic loadintgettype()get link typebooleanisintrarack()is it an intra-rack link?voidremload(java.lang.Double a)remove trafficvoidsetcapacity(java.lang.Double c)set capacityvoidsetintrarack()define this link as intra-rack linkvoidsettype(int t)set link typeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
id
int idlink ID -
linkednodes
int[] linkednodesIDs of the nodes connected by the link -
linktype
int linktypelinktype 0 for bidirectional, 1 input only, 2 output only, -1 for invalid or not operational -
intrarack
boolean intrarackis it an intra-rack link? -
capacity
java.lang.Double capacitylink capacity in Gbps -
load
java.lang.Double loadtraffic 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
-