public final class TimeVaryingNetState
extends SimState
Constructor and Description |
---|
TimeVaryingNetState(NetPlan netPlan)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkProtectionSegmentMergeabilityToRoute(long routeId,
long segmentId)
Tests whether a given protection segment is applicable to a route.
|
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.
|
SimState |
copy()
Returns a deep copy of the current state.
|
double |
getDemandCarriedTrafficInErlangs(int demandId)
Returns the carried traffic for a given demand.
|
double[] |
getDemandCarriedTrafficInErlangsVector()
Returns the carried traffic for each demand.
|
double |
getDemandOfferedTrafficInErlangs(int demandId)
Returns the offered traffic for a given demand.
|
double[] |
getDemandOfferedTrafficInErlangsVector()
Returns the offered traffic for each demand.
|
long[] |
getDemandRoutes(int demandId)
Returns the routes which can carry traffic from a given demand.
|
java.lang.String |
getLinkAttribute(long linkId,
java.lang.String key)
Returns the value of a given attribute for a link.
|
double |
getLinkCapacityInErlangs(long linkId)
Returns the link capacity.
|
double |
getLinkCapacityNotReservedForProtectionInErlangs(long linkId)
Returns the link capacity not reserved for protection.
|
double |
getLinkCapacityReservedForProtectionInErlangs(long linkId)
Returns the link capacity reserved for protection.
|
double |
getLinkCarriedTrafficInErlangs(long linkId)
Returns the carried traffic by a given link.
|
int |
getLinkDestinationNode(long linkId)
Returns the identifier of the destination node of the link.
|
long[] |
getLinkIds()
Returns the set of current link identifiers.
|
double |
getLinkLengthInKm(long linkId)
Returns the length of the specified link.
|
long |
getLinkNextId()
Returns the link identifier for the next created link.
|
int |
getLinkOriginNode(long linkId)
Returns the identifier of the origin node of the link.
|
java.util.Map<java.lang.String,java.lang.String> |
getLinkSpecificAttributes(long linkId)
Returns the attributes of a given link.
|
long[] |
getLinkSRGs(long linkId)
Returns all SRGs associated to a given link.
|
long[] |
getLinkTraversingProtectionSegments(long linkId)
Returns the protection segments traversing a given link.
|
long[] |
getLinkTraversingRoutes(long linkId)
Returns the routes traversing a given link.
|
double[] |
getNodeEgressTrafficInErlangsVector()
Returns the egress traffic per node.
|
long[] |
getNodeIncomingLinks(int nodeId)
Returns the links ending in a given node.
|
long[] |
getNodeIncomingRoutes(int nodeId)
Returns the routes ending in a given node.
|
double[] |
getNodeIngressTrafficInErlangsVector()
Returns the ingress traffic per node.
|
long[] |
getNodeOutgoingLinks(int nodeId)
Returns the links starting from a given node.
|
long[] |
getNodeOutgoingRoutes(int nodeId)
Returns the links starting from a given node.
|
long[] |
getNodePairBidirectionalLinks(int node1,
int node2)
Returns links between two nodes (in both senses).
|
long[] |
getNodePairLinks(int node1,
int node2)
Returns the links from a node to other one.
|
long[] |
getNodePairRoutes(int node1,
int node2)
Returns the routes going from a node to other one.
|
long[] |
getNodeSRGs(int nodeId)
Returns all SRGs associated to a given node.
|
long[] |
getNodeTraversingProtectionSegments(int nodeId)
Returns the protection segments traversing a given node.
|
long[] |
getNodeTraversingRoutes(int nodeId)
Returns the routes traversing a given node.
|
double[] |
getNodeTraversingTrafficInErlangsVector()
Returns the traversing traffic (no ingress, no egress) per node.
|
int |
getNumberOfLinks()
Returns the number of unidirectional links defined within the network.
|
int |
getNumberOfProtectionSegments()
Returns the number of protection segments defined within the network.
|
int |
getNumberOfRoutes()
Returns the number of routes for traffic demands defined within the network.
|
int |
getNumberOfSRGs()
Returns the number of SRGs defined within the network.
|
java.lang.String |
getProtectionSegmentAttribute(long segmentId,
java.lang.String key)
Returns the value of a given attribute for a protection segment.
|
int |
getProtectionSegmentDestinationNode(long segmentId)
Returns the identifier of the destination node of the protection segment.
|
long[] |
getProtectionSegmentIds()
Returns the set of current protection segment identifiers.
|
double |
getProtectionSegmentLengthInKm(long segmentId)
Returns the length in kilometers for a given protection segment.
|
long |
getProtectionSegmentNextId()
Returns the connection identifier for the next created connection.
|
int |
getProtectionSegmentNumberOfHops(long segmentId)
Returns the number of hops for a given protection segment.
|
int |
getProtectionSegmentOriginNode(long segmentId)
Returns the identifier of the origin node of the protection segment.
|
double |
getProtectionSegmentReservedBandwidthInErlangs(long segmentId)
Returns the reserved bandwidth for a given protection segment.
|
long[] |
getProtectionSegmentRoutes(long segmentId)
Returns the routes which share a given protection segment.
|
long[] |
getProtectionSegmentSequenceOfLinks(long segmentId)
Returns the sequence of links traversed by a protection segment.
|
int[] |
getProtectionSegmentSequenceOfNodes(long segmentId)
Returns the sequence of nodes traversed by a protection segment.
|
java.util.Map<java.lang.String,java.lang.String> |
getProtectionSegmentSpecificAttributes(long segmentId)
Returns the attributes for a given protection segment.
|
long[] |
getProtectionSegmentSRGs(long segmentId)
Returns all SRGs associated to a given protection segment.
|
java.lang.String |
getRouteAttribute(long routeId,
java.lang.String key)
Returns the value of a given attribute for a route.
|
long[] |
getRouteBackupSegmentList(long routeId)
Returns the protection segments defined for a given route.
|
double |
getRouteCarriedTrafficInErlangs(long routeId)
Returns the carried traffic for a given route.
|
int |
getRouteDemand(long routeId)
Returns the associated demand for a given route.
|
int |
getRouteEgressNode(long routeId)
Returns the identifier of the egress node of the route.
|
long[] |
getRouteIds()
Returns the set of current route identifiers.
|
int |
getRouteIngressNode(long routeId)
Returns the identifier of the ingress node of the route.
|
double |
getRouteLengthInKm(long routeId)
Returns the length in kilometers for each route.
|
long |
getRouteNextId()
Returns the route identifier for the next created route.
|
int |
getRouteNumberOfHops(long routeId)
Returns the number of hops for a given route.
|
long[] |
getRouteSequenceOfLinks(long routeId)
Returns the sequence of links traversed by a route.
|
int[] |
getRouteSequenceOfNodes(long routeId)
Returns the sequence of nodes traversed by a route.
|
java.util.Map<java.lang.String,java.lang.String> |
getRouteSpecificAttributes(long routeId)
Returns the attributes for a given route.
|
long[] |
getRouteSRGs(long routeId)
Returns all SRGs associated to a given route.
|
java.lang.String |
getSRGAttribute(long srgId,
java.lang.String key)
Returns the value of a given attribute for a SRG.
|
double |
getSRGAvailability(long srgId)
Returns the availability of the given SRG.
|
long[] |
getSRGIds()
Returns the set of current SRG identifiers.
|
long[] |
getSRGLinks(long srgId)
Returns the set of links in a given SRG.
|
double |
getSRGMeanTimeToFailInHours(long srgId)
Returns the Mean Time To Fail (in hours) of the given SRG.
|
double |
getSRGMeanTimeToRepairInHours(long srgId)
Returns the Mean Time To Repair (in hours) of the given SRG.
|
long |
getSRGNextId()
Returns the SRG identifier for the next created SRG.
|
int[] |
getSRGNodes(long srgId)
Returns the set of nodes in a given SRG.
|
long[] |
getSRGProtectionSegments(long srgId)
Returns the set of protection segments affected by a given SRG.
|
long[] |
getSRGRoutes(long srgId)
Returns the set of routes affected by a given SRG.
|
java.util.Map<java.lang.String,java.lang.String> |
getSRGSpecificAttributes(long srgId)
Returns the attributes for a given SRG.
|
boolean |
hasLinks()
Returns
true if the network has at least one unidirectional link. |
boolean |
hasProtectionSegments()
Returns
true if the network has at least one protection segment. |
boolean |
hasRoutes()
Returns
true if the network has at least one traffic route. |
boolean |
hasSRGs()
Returns
true if the network has at least one SRG. |
void |
reset()
Resets the state of the network.
|
SimState |
unmodifiableView()
Returns an unmodifiable view of the network.
|
java.lang.Object |
update(SimEvent event,
java.util.List actions)
Update the network state.
|
public TimeVaryingNetState(NetPlan netPlan)
netPlan
- Initial network designpublic NetPlan convertToNetPlan()
public SimState copy()
public SimState unmodifiableView()
public java.lang.Object update(SimEvent event, java.util.List actions)
event
- Current simulation eventactions
- List of actions to performnull
objectpublic long getLinkNextId()
public long getRouteNextId()
public long getProtectionSegmentNextId()
public long getSRGNextId()
public void checkValidity(java.util.Map<java.lang.String,java.lang.String> net2planParameters, boolean allowLinkOversubscription, boolean allowExcessCarriedTraffic)
public void reset()
public java.lang.String getLinkAttribute(long linkId, java.lang.String key)
linkId
- Link identifierkey
- Attribute namepublic double getLinkCapacityInErlangs(long linkId)
linkId
- Link identifierpublic double getLinkCapacityReservedForProtectionInErlangs(long linkId)
linkId
- Link identifierpublic double getLinkCapacityNotReservedForProtectionInErlangs(long linkId)
linkId
- Link identifierpublic int getLinkDestinationNode(long linkId)
linkId
- Link identifierpublic double getLinkLengthInKm(long linkId)
linkId
- Link identifierpublic int getLinkOriginNode(long linkId)
linkId
- Link identifierpublic long[] getNodeOutgoingRoutes(int nodeId)
nodeId
- Node identifierspublic long[] getNodeIncomingRoutes(int nodeId)
nodeId
- Node identifierspublic long[] getNodeIncomingLinks(int nodeId)
nodeId
- Node identifierspublic long[] getNodeOutgoingLinks(int nodeId)
nodeId
- Node identifierspublic int getNumberOfLinks()
public int getNumberOfRoutes()
public int getNumberOfProtectionSegments()
public java.lang.String getRouteAttribute(long routeId, java.lang.String key)
routeId
- Route identifierkey
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getRouteSpecificAttributes(long routeId)
routeId
- Route identifierpublic long[] getRouteBackupSegmentList(long routeId)
routeId
- Route identifierpublic int getRouteDemand(long routeId)
routeId
- Route identifierpublic long[] getDemandRoutes(int demandId)
demandId
- Demand identifierpublic double getRouteCarriedTrafficInErlangs(long routeId)
routeId
- Route identifierpublic double getProtectionSegmentLengthInKm(long segmentId)
segmentId
- Protection segment identifierpublic int getProtectionSegmentNumberOfHops(long segmentId)
segmentId
- Protection segment identifierpublic double getRouteLengthInKm(long routeId)
routeId
- Route identifierpublic int getRouteNumberOfHops(long routeId)
routeId
- Route identifierpublic long[] getRouteSequenceOfLinks(long routeId)
routeId
- Route identifierpublic int[] getRouteSequenceOfNodes(long routeId)
routeId
- Route identifierpublic long[] getLinkTraversingRoutes(long linkId)
linkId
- Link identifierpublic java.lang.String getProtectionSegmentAttribute(long segmentId, java.lang.String key)
segmentId
- Protection segment identifierkey
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getProtectionSegmentSpecificAttributes(long segmentId)
segmentId
- Segment identifierpublic int getProtectionSegmentDestinationNode(long segmentId)
segmentId
- Segment identifierpublic int getProtectionSegmentOriginNode(long segmentId)
segmentId
- Segment identifierpublic double getProtectionSegmentReservedBandwidthInErlangs(long segmentId)
segmentId
- Protection segment identifierpublic long[] getProtectionSegmentRoutes(long segmentId)
segmentId
- Protection segment identifierpublic long[] getProtectionSegmentSequenceOfLinks(long segmentId)
segmentId
- Protection segment identifierpublic int[] getProtectionSegmentSequenceOfNodes(long segmentId)
segmentId
- Protection segment identifierpublic long[] getLinkTraversingProtectionSegments(long linkId)
linkId
- Link identifierpublic long[] getNodeTraversingRoutes(int nodeId)
nodeId
- Node identifierpublic long[] getNodeTraversingProtectionSegments(int nodeId)
nodeId
- Node identifierpublic boolean hasLinks()
true
if the network has at least one unidirectional link. It is equivalent to getNumberOfLinks()
> 0
.true
if there are links within the network, and false
otherwisepublic boolean hasRoutes()
true
if the network has at least one traffic route. It is equivalent to getNumberOfRoutes()
> 0
.true
if there are routes defined for any traffic demand in the network, and false
otherwisepublic boolean hasProtectionSegments()
true
if the network has at least one protection segment. It is equivalent to getNumberOfProtectionSegments()
> 0
.true
if there are protection segments defined within the network, and false
otherwisepublic boolean checkProtectionSegmentMergeabilityToRoute(long routeId, long segmentId)
segmentId
- Segment identifierrouteId
- Route identifiertrue
is segment is applicable to route, false
otherwisepublic int getRouteIngressNode(long routeId)
routeId
- Route identifierpublic int getRouteEgressNode(long routeId)
routeId
- Route identifierpublic long[] getNodePairRoutes(int node1, int node2)
node1
- Ingress nodenode2
- Egress nodepublic long[] getNodePairBidirectionalLinks(int node1, int node2)
node1
- Node 1node2
- Node 2public long[] getNodePairLinks(int node1, int node2)
node1
- Origin nodenode2
- Destination nodepublic long[] getLinkSRGs(long linkId)
linkId
- Link identifierpublic long[] getNodeSRGs(int nodeId)
nodeId
- Node identifierpublic long[] getProtectionSegmentSRGs(long segmentId)
segmentId
- Segment identifierpublic long[] getRouteSRGs(long routeId)
routeId
- Route identifierpublic int getNumberOfSRGs()
public java.lang.String getSRGAttribute(long srgId, java.lang.String key)
srgId
- SRG identifierkey
- Attribute namepublic double getSRGAvailability(long srgId)
srgId
- SRG identifierpublic long[] getSRGLinks(long srgId)
srgId
- SRG identifierpublic double getSRGMeanTimeToFailInHours(long srgId)
srgId
- SRG identifierpublic double getSRGMeanTimeToRepairInHours(long srgId)
srgId
- SRG identifierpublic int[] getSRGNodes(long srgId)
srgId
- SRG identifierpublic long[] getSRGProtectionSegments(long srgId)
srgId
- SRG identifierpublic long[] getSRGRoutes(long srgId)
srgId
- SRG identifierpublic java.util.Map<java.lang.String,java.lang.String> getSRGSpecificAttributes(long srgId)
srgId
- SRG identifierpublic boolean hasSRGs()
true
if the network has at least one SRG.
It is equivalent to getNumberOfSRGs()
> 0.true
if there are SRGs defined for the network, and false
otherwisepublic double[] getNodeEgressTrafficInErlangsVector()
public double[] getNodeIngressTrafficInErlangsVector()
public double[] getNodeTraversingTrafficInErlangsVector()
public long[] getLinkIds()
public long[] getRouteIds()
public long[] getProtectionSegmentIds()
public long[] getSRGIds()
public java.util.Map<java.lang.String,java.lang.String> getLinkSpecificAttributes(long linkId)
linkId
- Link identifierpublic double getDemandCarriedTrafficInErlangs(int demandId)
demandId
- Demand identifierpublic double getDemandOfferedTrafficInErlangs(int demandId)
demandId
- Demand identifierpublic double getLinkCarriedTrafficInErlangs(long linkId)
linkId
- Link identifierpublic double[] getDemandCarriedTrafficInErlangsVector()
public double[] getDemandOfferedTrafficInErlangsVector()