public final class ConnectionNetState
extends SimState
Important: Users only should use this class only for queries via
getX()
methods, since kernel is in charge of modifying the network
state using the events (CACEvent
)
scheduled by the event generator (see IConnectionEventGenerator
)
and the actions (see CACAction
)
provided by the event processor (see ICACAlgorithm
).
Constructor and Description |
---|
ConnectionNetState(NetPlan netPlan)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkValidity(java.util.Map<java.lang.String,java.lang.String> net2planParameters,
boolean allowLinkOversubscription,
boolean allowExcessCarriedTraffic) |
NetPlan |
convertToNetPlan()
Returns a network design from the current network state.
|
ConnectionNetState |
copy()
Returns a deep copy of the current state.
|
double |
getConnectionArrivalTime(long connId)
Returns the arrival time of the specified connection.
|
java.lang.String |
getConnectionAttribute(long connId,
java.lang.String key)
Returns the value of a given attribute for a connection route.
|
java.util.Map<java.lang.String,java.lang.String> |
getConnectionAttributes(long connId)
Returns the set of attributes of a given connection.
|
double |
getConnectionCurrentCarriedTrafficInErlangs(long connId)
Returns the current traffic volume for a given connection.
|
int |
getConnectionDemand(long connId)
Returns the demand identifier for a given connection.
|
double |
getConnectionDuration(long connId)
Returns the duration of the specified connection.
|
long[] |
getConnectionIds()
Returns the set of active connection identifiers (in ascending order).
|
long |
getConnectionNextId()
Returns the connection identifier for the next created connection.
|
double |
getConnectionRequestedTrafficInErlangs(long connId)
Returns the requested traffic volume for a given connection.
|
java.lang.String |
getConnectionRouteAttribute(long connRouteId,
java.lang.String key)
Returns the value of a given attribute for a connection route.
|
java.util.Map<java.lang.String,java.lang.String> |
getConnectionRouteAttributes(long connRouteId)
Returns the set of attributes of a given connection route.
|
double |
getConnectionRouteCarriedTrafficInErlangs(long connRouteId)
Returns the current traffic volume for a given connection route.
|
long |
getConnectionRouteConnection(long connRouteId)
Returns the connection identifier for the given connection route.
|
long[] |
getConnectionRouteIds()
Returns the set of active connection route identifiers (in ascending order).
|
long |
getConnectionRouteNextId()
Returns the connection identifier for the next created connection route.
|
long[] |
getConnectionRoutes(long connId)
Returns the connection route identifiers associated to the connection.
|
int[] |
getConnectionRouteSequenceOfLinks(long connRouteId)
Returns the sequence of links traversed by a given connection route.
|
double[] |
getDemandCurrentCarriedTrafficInErlangsVector()
Returns a vector with the carried traffic per demand.
|
long[] |
getDemandCurrentConnections(int demandId)
Returns the set of connection ids associated to a given demand.
|
int[] |
getDemandCurrentNumberOfConnectionsVector()
Returns the number of current active connections per each demand.
|
double[] |
getDemandCurrentOfferedTrafficInErlangsVector()
Returns a vector with the offered traffic per demand.
|
double[] |
getLinkCurrentCarriedTrafficInErlangsVector()
Returns a vector with the carried traffic per link.
|
int[] |
getLinkCurrentNumberOfTraversingConnectionRoutesVector()
Returns the number of current traversing connection routes per each link.
|
double[] |
getLinkCurrentSpareCapacityInErlangsVector()
Returns a vector with the spare capacity per link.
|
long[] |
getLinkCurrentTraversingConnectionRoutes(int linkId)
Returns the list of connection routes traversing the given link.
|
double[] |
getNodeCurrentEgressTrafficInErlangsVector()
Returns the current egress traffic from each node.
|
double[] |
getNodeCurrentIngressTrafficInErlangsVector()
Returns the current ingress traffic to each node.
|
double[] |
getNodeCurrentTraversingTrafficInErlangsVector()
Returns the current traffic traversing each node.
|
int |
getNumberOfConnectionRoutes()
Returns the number of active connection routes in the network.
|
int |
getNumberOfConnections()
Returns the number of active connections in the network.
|
boolean |
hasConnectionRoutes()
Returns
true if the network has at least one active connection. |
boolean |
hasConnections()
Returns
true if the network has at least one active connection. |
boolean |
isActiveConnection(long connId)
Returns
true if the given connection is active. |
boolean |
isActiveConnectionRoute(long connRoute)
Returns
true if the given connection route is active. |
void |
reset()
Resets the state of the network.
|
ConnectionNetState |
unmodifiableView()
Returns an unmodifiable view of the network.
|
java.lang.Object |
update(SimEvent event,
java.util.List actions)
Update the network state.
|
public ConnectionNetState(NetPlan netPlan)
netPlan
- Complete network design (including traffic demands)public NetPlan convertToNetPlan()
public void checkValidity(java.util.Map<java.lang.String,java.lang.String> net2planParameters, boolean allowLinkOversubscription, boolean allowExcessCarriedTraffic)
public ConnectionNetState copy()
public ConnectionNetState unmodifiableView()
public double getConnectionArrivalTime(long connId)
connId
- Connection identifierpublic java.lang.String getConnectionAttribute(long connId, java.lang.String key)
connId
- Connection identifierkey
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getConnectionAttributes(long connId)
connId
- Connection identifierpublic double getConnectionCurrentCarriedTrafficInErlangs(long connId)
connId
- Connection identifierpublic int getConnectionDemand(long connId)
connId
- Connection identifierpublic double getConnectionDuration(long connId)
connId
- Connection identifierpublic long[] getConnectionIds()
public long getConnectionNextId()
public java.lang.String getConnectionRouteAttribute(long connRouteId, java.lang.String key)
connRouteId
- Connection route identifierkey
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getConnectionRouteAttributes(long connRouteId)
connRouteId
- Connection route identifierpublic double getConnectionRouteCarriedTrafficInErlangs(long connRouteId)
connRouteId
- Connection route identifierpublic long[] getConnectionRouteIds()
public double getConnectionRequestedTrafficInErlangs(long connId)
connId
- Connection identifierpublic long getConnectionRouteConnection(long connRouteId)
connRouteId
- Connection route identifierpublic long getConnectionRouteNextId()
public long[] getConnectionRoutes(long connId)
connId
- Connection identifierpublic int[] getConnectionRouteSequenceOfLinks(long connRouteId)
connRouteId
- Connection route identifierpublic long[] getDemandCurrentConnections(int demandId)
demandId
- Demand identifierpublic double[] getDemandCurrentCarriedTrafficInErlangsVector()
public double[] getDemandCurrentOfferedTrafficInErlangsVector()
public int[] getDemandCurrentNumberOfConnectionsVector()
public double[] getLinkCurrentCarriedTrafficInErlangsVector()
public int[] getLinkCurrentNumberOfTraversingConnectionRoutesVector()
public double[] getLinkCurrentSpareCapacityInErlangsVector()
public long[] getLinkCurrentTraversingConnectionRoutes(int linkId)
linkId
- Link identifierpublic double[] getNodeCurrentEgressTrafficInErlangsVector()
public double[] getNodeCurrentIngressTrafficInErlangsVector()
public double[] getNodeCurrentTraversingTrafficInErlangsVector()
public int getNumberOfConnections()
public int getNumberOfConnectionRoutes()
public boolean hasConnections()
true
if the network has at least one active connection. It is equivalent to getNumberOfConnections()
> 0
.true
if there are active connections in the network, and false
otherwisepublic boolean hasConnectionRoutes()
true
if the network has at least one active connection. It is equivalent to getNumberOfConnectionRoutes()
> 0
.true
if there are active connections in the network, and false
otherwisepublic boolean isActiveConnection(long connId)
true
if the given connection is active.connId
- Connection identifiertrue
if the given connection is active, false
otherwisepublic boolean isActiveConnectionRoute(long connRoute)
true
if the given connection route is active.connRoute
- Connection route identifiertrue
if the given connection route is active, false
otherwisepublic java.lang.Object update(SimEvent event, java.util.List actions)
event
- Current simulation eventactions
- List of actions to performpublic void reset()