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 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 void
addload(java.lang.Double a)
set current traffic loadjava.lang.Double
getavailableband()
get available bandwidthjava.lang.Double
getcapacity()
get capacityint[]
getconnected()
get the nodes connected by the linkint
getid()
get link idjava.lang.Double
getload()
get current traffic loadint
gettype()
get link typeboolean
isintrarack()
is it an intra-rack link?void
remload(java.lang.Double a)
remove trafficvoid
setcapacity(java.lang.Double c)
set capacityvoid
setintrarack()
define this link as intra-rack linkvoid
settype(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
-