edu.colorado.cs.ns2.sim
Class Link

java.lang.Object
  extended by edu.colorado.cs.ns2.sim.Link
All Implemented Interfaces:
java.io.Serializable

public class Link
extends java.lang.Object
implements java.io.Serializable

This class implements the NS2 notion of a Link. A Link provides a means by which to physically connect two nodes. Links are defined by the nodes that they connect, a queuing model, a bandwidth, latency, and optional queue arguments.

Author:
Kevin Bauer, Pushkar Sambhoos.
See Also:
Serialized Form

Field Summary
private  java.lang.String args
          The queue's arguments.
private  double bandwidth
          The bandwidth (Mb/s).
private  ConnectionList connectionList
          A list of connections on this link.
private  ExtendedLinkProperties elp
          The extended link properties for this link.
private  double latency
          The latency (ms).
private  NsNode node1
          The NS2 node at endpoint 1.
private  NsNode node2
          The NS2 node at endpoint 2.
private  java.lang.String queueType
          The queuing model.
private static long serialVersionUID
          Generated serial version UID.
 
Constructor Summary
Link()
          Default constructor.
Link(NsNode n1, NsNode n2, double bw, double lat, java.lang.String qType, java.lang.String args)
          Six-argument constructor.
 
Method Summary
 java.lang.String getArgs()
          Returns the queue's arguments.
 double getBandwidth()
          Returns the link's bandwdith.
 ConnectionList getConnections()
          Returns the connection list for this link.
 ExtendedLinkProperties getExtendedLinkProperties()
          Returns the extended link properties for this link.
 double getLatency()
          Returns the link's latency value.
 NsNode getNode1()
          Returns the node at endpoint 1.
 NsNode getNode2()
          Returns the node at endpoint 2.
 java.lang.String getQueueType()
          Returns the queue type.
 void setArgs(java.lang.String args)
          Sets the queue's arguments.
 void setBandwidth(double bandwidth)
          Sets the link's bandwidth.
 void setConnections(ConnectionList c)
          Set the connection list for this link.
 void setExtendedLinkProperties(ExtendedLinkProperties elp)
          Sets the extended properties for this link.
 void setLatency(double latency)
          Sets the link's latency value.
 void setNode1(NsNode node1)
          Sets the node at endpoint 1.
 void setNode2(NsNode node2)
          Sets the node at endpoint 2.
 void setQueueType(java.lang.String queueType)
          Sets the queue type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Generated serial version UID.

See Also:
Constant Field Values

node1

private NsNode node1
The NS2 node at endpoint 1.


node2

private NsNode node2
The NS2 node at endpoint 2.


queueType

private java.lang.String queueType
The queuing model.


bandwidth

private double bandwidth
The bandwidth (Mb/s).


latency

private double latency
The latency (ms).


args

private java.lang.String args
The queue's arguments.


connectionList

private ConnectionList connectionList
A list of connections on this link.


elp

private ExtendedLinkProperties elp
The extended link properties for this link.

Constructor Detail

Link

public Link()
Default constructor.


Link

public Link(NsNode n1,
            NsNode n2,
            double bw,
            double lat,
            java.lang.String qType,
            java.lang.String args)
Six-argument constructor.

Parameters:
n1 - The node at endpoint 1.
n2 - The node at endpoint 2.
bw - The link's bandwidth.
lat - The link's latency.
qType - The queuing model.
args - The queue's arguments.
Method Detail

setConnections

public void setConnections(ConnectionList c)
Set the connection list for this link.

Parameters:
c -

getConnections

public ConnectionList getConnections()
Returns the connection list for this link.

Returns:
The connection list for this link.

getArgs

public java.lang.String getArgs()
Returns the queue's arguments.

Returns:

setArgs

public void setArgs(java.lang.String args)
Sets the queue's arguments.

Parameters:
args - The queue's arguments.

getBandwidth

public double getBandwidth()
Returns the link's bandwdith.

Returns:
The link's bandwidth.

setBandwidth

public void setBandwidth(double bandwidth)
Sets the link's bandwidth.

Parameters:
bandwidth - The link's new bandwidth value.

getLatency

public double getLatency()
Returns the link's latency value.

Returns:
The link's latency value.

setLatency

public void setLatency(double latency)
Sets the link's latency value.

Parameters:
latency - A new latency value.

getNode1

public NsNode getNode1()
Returns the node at endpoint 1.

Returns:
The node at endpoint 1.

setNode1

public void setNode1(NsNode node1)
Sets the node at endpoint 1.

Parameters:
node1 - Sets the node at endpoint 1.

getNode2

public NsNode getNode2()
Returns the node at endpoint 2.

Returns:
The node at endpoint 2.

setNode2

public void setNode2(NsNode node2)
Sets the node at endpoint 2.

Parameters:
node2 - A new node at endpoint 2.

getQueueType

public java.lang.String getQueueType()
Returns the queue type.

Returns:
The queue type.

setQueueType

public void setQueueType(java.lang.String queueType)
Sets the queue type.

Parameters:
queueType - A new queue type.

getExtendedLinkProperties

public ExtendedLinkProperties getExtendedLinkProperties()
Returns the extended link properties for this link.

Returns:

setExtendedLinkProperties

public void setExtendedLinkProperties(ExtendedLinkProperties elp)
Sets the extended properties for this link.

Parameters:
elp - New extended properties for this link.