|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbcds.phison.ra.ConnectionInfo<V,E>
public class ConnectionInfo<V,E>
Holds information about a connection, such as its working and backup path (if any), a reference to the routing algorithm used to allocate capacity, the source and destination, among others.
Typically, instances of this class are kept in the TED object.
This class should be viewed as a "struct" in the sense that its data members are all public and some of them can only be changed through direct access (no setter/getter is available).
Field Summary | |
---|---|
boolean |
bkp_in_use
Set to true to indicate that this connection is using the backup path (for example, when the working path has failed). |
Path<V,E> |
bkp_path
Backup path assigned to this connection (it can be null). |
int |
cap
Capacity assigned to this connection (the unit is up to the user). |
int |
clock
The connection creation time (in simulated time). |
V |
dest
Destination node of the connection. |
int |
duration
The connection duration, in units of simulated time. |
int |
failed_at
Simulation time at which this connection has failed. |
int |
id
The connection id: it can be any number (it is up to the user). |
RoutingAlg<V,E> |
ra
A reference to the routing algorithm that was used to find the paths for this connection. |
V |
src
Source node of the connection. |
java.lang.String |
traf_type
The "traffic type"; the meaning assigned to this field is entirely up to the user. |
Path<V,E> |
wrk_path
Working path assigned to this connection. |
Constructor Summary | |
---|---|
ConnectionInfo(ConnectionInfo<V,E> c)
Copy constructor (Beware: shallow copy). |
|
ConnectionInfo(int id,
int cap,
Path<V,E> wrk_path,
Path<V,E> bkp_path)
Instanciates a ConnectionInfo , with a given id, capacity and
paths. |
Method Summary | |
---|---|
boolean |
backupIsActive()
Returns true when backup path is active. |
void |
setBackupStatus(boolean bkp_is_active)
Sets the "backup path is in use" flag. |
java.lang.String |
toString()
A partial (string) representation of a ConnectionInfo object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int id
public java.lang.String traf_type
public V src
public V dest
public int cap
public Path<V,E> wrk_path
src
and
dest
respectively, although this is not
checked.
public Path<V,E> bkp_path
wrk_path
.
public boolean bkp_in_use
public RoutingAlg<V,E> ra
public int clock
public int duration
public int failed_at
bkp_path
is not null). It should be reset to zero as soon as the connection
is restored.
Constructor Detail |
---|
public ConnectionInfo(int id, int cap, Path<V,E> wrk_path, Path<V,E> bkp_path)
ConnectionInfo
, with a given id, capacity and
paths. The reference to the routing algorithm is set to null
and the indicator of "backup in use" (see bkp_in_use
) is
set to false.
The parameter wrk_path
must not be null, whereas
bkp_path
may be null.
public ConnectionInfo(ConnectionInfo<V,E> c)
Method Detail |
---|
public void setBackupStatus(boolean bkp_is_active)
public boolean backupIsActive()
public java.lang.String toString()
ConnectionInfo
object.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |