gps.network
Class Connection

java.lang.Object
  extended by gps.network.Connection
Direct Known Subclasses:
BTConnection

public class Connection
extends java.lang.Object

high level directed connection between nodes

Version:
1.2, 6/20/2005
Author:
Weishuai Yang

Constructor Summary
Connection(Agent a, Agent b)
          constructs a connection between agents
Connection(Node a, Node b)
          constructs a connection between nodes
 
Method Summary
 void adjustBandwidth(double adj)
          adjust bandwidth for provided amount
 Link findBottleNeck(boolean forward)
          finds bottle neck along links
static java.util.ArrayList getAllConnections()
          get all the connections in the system, class method
 double getBandwidth()
          gets bandwidth allocated for this connection
 double getBandwidthFrom(Node n)
          gets one way bandwidth
 boolean isActive()
          get active status
static void printConnections()
          print all connections in system, just for debug purpose
 void relaxBandwidthAlongTheWay()
           
 void setActive()
          make connection active
 void setBandwidthFrom(Node n, double b)
          sets one way bandwidth
 void setInActive()
          makes connection inactive
 void setUp()
          setup this connection along links
 void tearDown()
          tear down the connection
 java.lang.String toString()
          gets string description
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Connection

public Connection(Agent a,
                  Agent b)
constructs a connection between agents

Parameters:
a - source agent
b - destination agent

Connection

public Connection(Node a,
                  Node b)
constructs a connection between nodes

Parameters:
a - source node
b - destination node
Method Detail

getAllConnections

public static java.util.ArrayList getAllConnections()
get all the connections in the system, class method

Returns:
connection list

printConnections

public static void printConnections()
print all connections in system, just for debug purpose


setUp

public void setUp()
setup this connection along links


setActive

public void setActive()
make connection active


isActive

public boolean isActive()
get active status

Returns:
true if active, otherwise false

findBottleNeck

public Link findBottleNeck(boolean forward)
finds bottle neck along links

Parameters:
forward - true means search forward, otherwise backward

getBandwidth

public double getBandwidth()
gets bandwidth allocated for this connection

Returns:
allocated bandwidth

getBandwidthFrom

public double getBandwidthFrom(Node n)
gets one way bandwidth

Parameters:
n - source
Returns:
bandwidth from source

setBandwidthFrom

public void setBandwidthFrom(Node n,
                             double b)
sets one way bandwidth

Parameters:
n - source
b - new bandwidth value

setInActive

public void setInActive()
makes connection inactive


relaxBandwidthAlongTheWay

public void relaxBandwidthAlongTheWay()

tearDown

public void tearDown()
tear down the connection


adjustBandwidth

public void adjustBandwidth(double adj)
adjust bandwidth for provided amount

Parameters:
adj - adjust amount

toString

public java.lang.String toString()
gets string description

Overrides:
toString in class java.lang.Object
Returns:
string description