public final class NetPlan
extends NetState
Class defining a complete network structure.
An unmodifiable version of NetPlan object can be obtained through the copy constructor. Instances work transparently as NetPlan object
unless you try to change it. Calling any method that can potentially change the network (e.g. add/set methods) throws an UnsupportedOperationException
.
Constructor and Description |
---|
NetPlan()
Default constructor.
|
NetPlan(java.io.File file)
Generates a new network structure from a given
.n2p file. |
Modifier and Type | Method and Description |
---|---|
int |
addDemand(int ingressNodeId,
int egressNodeId,
double offeredTrafficInErlangs,
java.util.Map<java.lang.String,java.lang.String> attributes)
Adds a new traffic demand to the network.
|
void |
addDemandsFrom(NetPlan demands)
Adds to the current network plan the traffic demand set from other network plan.
|
int |
addLink(int originNodeId,
int destinationNodeId,
double linkCapacityInErlangs,
double linkLengthInKm,
java.util.Map<java.lang.String,java.lang.String> attributes)
Adds a new link to the network.
|
void |
addLinkToSRG(int linkId,
int srgId)
Adds a link to a given SRG.
|
int |
addNode(double x,
double y,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes)
Adds a new node to the network.
|
void |
addNodeToSRG(int nodeId,
int srgId)
Adds a node to a given SRG.
|
int |
addProtectionSegment(int[] sequenceOfLinks,
double reservedBandwidthInErlangs,
java.util.Map<java.lang.String,java.lang.String> attributes)
Adds a new protection segment to the network.
|
void |
addProtectionSegmentToRouteBackupSegmentList(int segmentId,
int routeId)
Adds a protection segment to the list of backup protection segments of a route.
|
int |
addRoute(int demandId,
double carriedTrafficInErlangs,
int[] sequenceOfLinks,
int[] backupSegmentIds,
java.util.Map<java.lang.String,java.lang.String> attributes)
Adds a new traffic route to the network.
|
void |
addRoutes(CandidatePathList cpl,
double[] x_p,
boolean includeUnusedRoutes)
Adds traffic routes from a candidate path list.
|
int |
addSRG(int[] nodeIds,
int[] linkIds,
double mttf,
double mttr,
java.util.Map<java.lang.String,java.lang.String> attributes)
Adds a new SRG to the network.
|
boolean |
checkProtectionSegmentMergeabilityToRoute(int routeId,
int segmentId)
Tests whether a given protection segment is applicable to a route.
|
void |
checkRouteValidityForDemand(int[] sequenceOfLinks,
int demandId)
Checks if a sequence of links is valid for a given demand.
|
void |
checkValidity(java.util.Map<java.lang.String,java.lang.String> net2planParameters,
boolean allowLinkOversubscription,
boolean allowExcessCarriedTraffic) |
java.lang.String[] |
checkValidityAndWarnings(java.util.Map<java.lang.String,java.lang.String> net2planParameters,
boolean allowLinkOversubscription,
boolean allowExcessCarriedTraffic)
Checks the validity of the current network plan.
|
int[] |
convertSequenceOfLinks2SequenceOfNodes(int[] sequenceOfLinksAndSegments)
Converts a sequence of links and segments to a sequence of nodes.
|
NetPlan |
copy()
Returns a deep copy of the current design.
|
void |
copyFrom(NetPlan netPlan)
Removes all the current information from the
NetPlan object and copy the
information from the input NetPlan . |
java.lang.String |
getDemandAttribute(int demandId,
java.lang.String key)
Returns the value for an attribute of the given demand.
|
java.lang.String[] |
getDemandAttributeVector(java.lang.String key)
Returns the value of an attribute for each demand.
|
double |
getDemandCarriedTrafficInErlangs(int demandId)
Returns the carried traffic for a given demand.
|
double[] |
getDemandCarriedTrafficInErlangsVector()
Returns the carried traffic for each demand.
|
int |
getDemandEgressNode(int demandId)
Returns the identifier of the egress node of the demand.
|
int[] |
getDemandEgressNodeVector()
Returns the identifier of the egress node for every demand.
|
int |
getDemandIngressNode(int demandId)
Returns the identifier of the ingress node of the demand.
|
int[] |
getDemandIngressNodeVector()
Returns the identifier of the ingress node for every demand.
|
double |
getDemandOfferedTrafficInErlangs(int demandId)
Returns the offered traffic for a given demand.
|
double[] |
getDemandOfferedTrafficInErlangsVector()
Returns the offered traffic per demand vector.
|
int[] |
getDemandRoutes(int demandId)
Returns the routes which can carry traffic from a given demand.
|
java.util.Map<java.lang.String,java.lang.String> |
getDemandSpecificAttributes(int demandId)
Returns the attributes defined for a given demand.
|
int[][] |
getDemandTable()
Returns the Dx2 demand table, in which each row represent the ingress and egress node of that demand.
|
java.lang.String |
getLinkAttribute(int linkId,
java.lang.String key)
Returns the value of a given attribute for a link.
|
java.lang.String[] |
getLinkAttributeVector(java.lang.String key)
Returns the value of an attribute for each link.
|
double |
getLinkCapacityInErlangs(int linkId)
Returns the link capacity.
|
double[] |
getLinkCapacityInErlangsVector()
Returns the link capacity for each link.
|
double |
getLinkCapacityNotReservedForProtectionInErlangs(int linkId)
Returns the link capacity not reserved for protection.
|
double[] |
getLinkCapacityNotReservedForProtectionInErlangsVector()
Returns the link capacity not reserved for protection for each link.
|
double |
getLinkCapacityReservedForProtectionInErlangs(int linkId)
Returns the link capacity reserved for protection.
|
double[] |
getLinkCapacityReservedForProtectionInErlangsVector()
Returns the link capacity reserved for protection for each link.
|
double |
getLinkCarriedTrafficInErlangs(int linkId)
Returns the carried traffic by a given link.
|
double[] |
getLinkCarriedTrafficInErlangsVector()
Returns the carried traffic per link.
|
int |
getLinkDestinationNode(int linkId)
Returns the identifier of the destination node of the link.
|
double |
getLinkLengthInKm(int linkId)
Returns the length of the specified link.
|
double[] |
getLinkLengthInKmVector()
Returns the length for each link.
|
double |
getLinkMaximumUtilization()
Returns the maximum link utilization among all links.
|
double |
getLinkMaximumUtilizationWithoutConsiderReservedBandwidthForProtection()
Returns the maximum link utilization among all links, not including reserved bandwidth
for protection.
|
int |
getLinkOriginNode(int linkId)
Returns the identifier of the origin node of the link.
|
double |
getLinkPropagationDelayInSeconds(int linkId)
Returns the propagation delay in a given link.
|
double[] |
getLinkPropagationDelayInSecondsVector()
Returns the propagation delay for each link.
|
double[] |
getLinkSpareCapacityInErlangsVector()
Returns the capacity available for each link.
|
java.util.Map<java.lang.String,java.lang.String> |
getLinkSpecificAttributes(int linkId)
Returns the attributes of a given link.
|
int[] |
getLinkSRGs(int linkId)
Returns all SRGs associated to a given link.
|
int[][] |
getLinkSRGsVector()
Returns all SRGs associated to each node.
|
int[][] |
getLinkTable()
Returns the Ex2 link table, in which each row represent the origin and destination node of that link.
|
int[] |
getLinkTraversingProtectionSegments(int linkId)
Returns the protection segments traversing a given link.
|
int[] |
getLinkTraversingRoutes(int linkId)
Returns the routes traversing a given link.
|
double |
getLinkUtilization(int linkId)
Returns the utilization of a given link, including the capacity reserved
for protection segments as a part of the carried traffic.
|
double[] |
getLinkUtilizationVector()
Returns the link utilization vector.
|
double |
getLinkUtilizationWithoutConsiderReservedBandwidthForProtection(int linkId)
Returns the utilization of a given link, not including the capacity reserved
for protection segments as a part of the carried traffic.
|
double[] |
getLinkUtilizationWithoutConsiderReservedBandwidthForProtectionVector()
Returns the link utilization vector, not including reserved bandwidth
for protection.
|
java.lang.String |
getNetworkAttribute(java.lang.String key)
Returns the value of a network attribute.
|
java.util.Map<java.lang.String,java.lang.String> |
getNetworkAttributes()
Returns the network attributes.
|
java.lang.String |
getNetworkDescription()
Returns the network description.
|
java.lang.String |
getNetworkName()
Returns the network name.
|
java.lang.String |
getNodeAttribute(int nodeId,
java.lang.String key)
Returns the value of a given attribute for a node.
|
java.lang.String[] |
getNodeAttributeVector(java.lang.String key)
Returns the value of an attribute for each node.
|
double[] |
getNodeEgressTrafficInErlangsVector()
Returns the egress traffic per node.
|
int[] |
getNodeIncomingDemands(int nodeId)
Returns the demands ending in a given node.
|
int[] |
getNodeIncomingLinks(int nodeId)
Returns the links ending in a given node.
|
int[] |
getNodeIncomingRoutes(int nodeId)
Returns the routes ending in a given node.
|
double[] |
getNodeIngressTrafficInErlangsVector()
Returns the ingress traffic per node.
|
java.lang.String |
getNodeName(int nodeId)
Returns the node name.
|
java.lang.String[] |
getNodeNames(int[] nodeIds)
Returns the node name for a set of nodes.
|
java.lang.String[] |
getNodeNameVector()
Returns the name for each node.
|
int[] |
getNodeOutgoingDemands(int nodeId)
Returns the demands starting from a given node.
|
int[] |
getNodeOutgoingLinks(int nodeId)
Returns the links starting from a given node.
|
int[] |
getNodeOutgoingRoutes(int nodeId)
Returns the links starting from a given node.
|
int[] |
getNodePairBidirectionalLinks(int node1,
int node2)
Returns links between two nodes (in both senses).
|
int[] |
getNodePairDemands(int ingressNode,
int egressNode)
Gets all the demands from a given ingress node to a given egress node.
|
int[] |
getNodePairLinks(int node1,
int node2)
Returns the links from a node to other one.
|
double |
getNodePairPhysicalDistance(int nodeId1,
int nodeId2)
Gets the physical distance between a node pair.
|
int[] |
getNodePairRoutes(int node1,
int node2)
Returns the routes going from a node to other one.
|
java.util.Map<java.lang.String,java.lang.String> |
getNodeSpecificAttributes(int nodeId)
Returns the attributes defined for a given node.
|
int[] |
getNodeSRGs(int nodeId)
Returns all SRGs associated to a given node.
|
int[][] |
getNodeSRGsVector()
Returns all SRGs associated to each node.
|
int[] |
getNodeTraversingLinks(int nodeId)
Gets all the links which has a given node as origin or destination.
|
int[] |
getNodeTraversingProtectionSegments(int nodeId)
Returns the protection segments traversing a given node.
|
int[] |
getNodeTraversingRoutes(int nodeId)
Returns the routes traversing a given node.
|
double[] |
getNodeTraversingTrafficInErlangsVector()
Returns the traversing traffic (no ingress, no egress) per node.
|
double[] |
getNodeXYPosition(int nodeId)
Returns the node position in a XY-plane.
|
double[][] |
getNodeXYPositionTable()
Returns the Nx2 node position table, in which each row represent the node position in a 2D plane.
|
int |
getNumberOfDemands()
Returns the number of traffic demands defined within the network.
|
int |
getNumberOfLinks()
Returns the number of unidirectional links defined within the network.
|
int |
getNumberOfNodes()
Returns the number of nodes 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.
|
double[][] |
getPhysicalDistanceMatrix()
Returns the NxN physical Euclidean-distance matrix, where N is the number of nodes within the network.
|
java.util.List<int[]> |
getProtectionSegmentAllSequenceOfLinks()
Returns the list with the sequence of links for each protection segment.
|
java.lang.String |
getProtectionSegmentAttribute(int segmentId,
java.lang.String key)
Returns the value of a given attribute for a protection segment.
|
java.lang.String[] |
getProtectionSegmentAttributeVector(java.lang.String key)
Returns the value of an attribute for each protection segment.
|
int |
getProtectionSegmentDestinationNode(int segmentId)
Returns the identifier of the destination node of the protection segment.
|
boolean |
getProtectionSegmentIsDedicated(int segmentId)
Checks whether or not a protection segment is dedicated.
|
boolean[] |
getProtectionSegmentIsDedicatedVector()
Returns a vector indicating whether or not a protection segment is dedicated.
|
double |
getProtectionSegmentLengthInKm(int segmentId)
Returns the length in kilometers for a given protection segment.
|
double[] |
getProtectionSegmentLengthInKmVector()
Returns the length in kilometers for each protection segment.
|
int |
getProtectionSegmentNumberOfHops(int segmentId)
Returns the number of hops for a given protection segment.
|
int[] |
getProtectionSegmentNumberOfHopsVector()
Returns the number of hops for each protection segment.
|
int |
getProtectionSegmentOriginNode(int segmentId)
Returns the identifier of the origin node of the protection segment.
|
double |
getProtectionSegmentPropagationDelayInSeconds(int segmentId)
Returns the propagation delay in a given protection segment.
|
double[] |
getProtectionSegmentPropagationDelayInSecondsVector()
Returns the propagation delay for each segment.
|
double |
getProtectionSegmentReservedBandwidthInErlangs(int segmentId)
Returns the reserved bandwidth for a given protection segment.
|
double[] |
getProtectionSegmentReservedBandwithInErlangsVector()
Returns the reserved bandwidth for each protection segment.
|
int[] |
getProtectionSegmentRoutes(int segmentId)
Returns the routes which share a given protection segment.
|
int[] |
getProtectionSegmentSequenceOfLinks(int segmentId)
Returns the sequence of links traversed by a protection segment.
|
int[] |
getProtectionSegmentSequenceOfNodes(int segmentId)
Returns the sequence of nodes traversed by a protection segment.
|
java.util.Map<java.lang.String,java.lang.String> |
getProtectionSegmentSpecificAttributes(int segmentId)
Returns the attributes for a given protection segment.
|
int[] |
getProtectionSegmentSRGs(int segmentId)
Returns all SRGs associated to a given protection segment.
|
java.util.List<int[]> |
getRouteAllSequenceOfLinks()
Returns the list with the sequence of links for each route.
|
java.lang.String |
getRouteAttribute(int routeId,
java.lang.String key)
Returns the value of a given attribute for a route.
|
java.lang.String[] |
getRouteAttributeVector(java.lang.String key)
Returns the value of an attribute for each route.
|
int[] |
getRouteBackupSegmentList(int routeId)
Returns the protection segments defined for a given route.
|
double[] |
getRouteCarriedTrafficFractionVector()
Returns the fraction of traffic (from the offered traffic of the
associated demand) which is carried by each route.
|
double |
getRouteCarriedTrafficInErlangs(int routeId)
Returns the carried traffic for a given route.
|
double[] |
getRouteCarriedTrafficInErlangsVector()
Returns the carried traffic for each route.
|
int |
getRouteDemand(int routeId)
Returns the associated demand for a given route.
|
int[] |
getRouteDemandVector()
Returns for each route its associated demand.
|
int |
getRouteEgressNode(int routeId)
Returns the identifier of the egress node of the route.
|
int |
getRouteIngressNode(int routeId)
Returns the identifier of the ingress node of the route.
|
double |
getRouteLengthInKm(int routeId)
Returns the length in kilometers for each route.
|
double[] |
getRouteLengthInKmVector()
Returns the length in kilometers for each route.
|
int |
getRouteNumberOfHops(int routeId)
Returns the number of hops for a given route.
|
int[] |
getRouteNumberOfHopsVector()
Returns the number of hops for each route.
|
double |
getRoutePropagationDelayInSeconds(int routeId)
Returns the propagation delay in a given route.
|
double[] |
getRoutePropagationDelayInSecondsVector()
Returns the propagation delay for each route.
|
int[] |
getRouteSequenceOfLinks(int routeId)
Returns the sequence of links traversed by a route.
|
int[] |
getRouteSequenceOfNodes(int routeId)
Returns the sequence of nodes traversed by a route.
|
java.util.Map<java.lang.String,java.lang.String> |
getRouteSpecificAttributes(int routeId)
Returns the attributes for a given route.
|
int[] |
getRouteSRGs(int routeId)
Returns all SRGs associated to a given route.
|
java.lang.String |
getSRGAttribute(int srgId,
java.lang.String key)
Returns the value of a given attribute for a SRG.
|
java.lang.String[] |
getSRGAttributeVector(java.lang.String key)
Returns the value of an attribute for each SRG.
|
double |
getSRGAvailability(int srgId)
Returns the availability of the given SRG.
|
double[] |
getSRGAvailabilityVector()
Returns the availability for each SRG.
|
int[] |
getSRGLinks(int srgId)
Returns the set of links in a given SRG.
|
int[][] |
getSRGLinksVector()
Returns the set of links which are associated to each SRG.
|
double |
getSRGMeanTimeToFailInHours(int srgId)
Returns the Mean Time To Fail (in hours) of the given SRG.
|
double[] |
getSRGMeanTimeToFailInHoursVector()
Returns the Mean Time To Fail (in hours) for each SRG.
|
double |
getSRGMeanTimeToRepairInHours(int srgId)
Returns the Mean Time To Repair (in hours) of the given SRG.
|
double[] |
getSRGMeanTimeToRepairInHoursVector()
Returns the Mean Time To Repair (in hours) for each SRG.
|
int[] |
getSRGNodes(int srgId)
Returns the set of nodes in a given SRG.
|
int[][] |
getSRGNodesVector()
Returns the set of nodes which are associated to each SRG.
|
int[] |
getSRGProtectionSegments(int srgId)
Returns the set of protection segments affected by a given SRG.
|
int[] |
getSRGRoutes(int srgId)
Returns the set of routes affected by a given SRG.
|
java.util.Map<java.lang.String,java.lang.String> |
getSRGSpecificAttributes(int srgId)
Returns the attributes for a given SRG.
|
double[][] |
getTrafficMatrix()
Returns the traffic matrix.
|
boolean |
hasDemands()
Returns
true if the network has at least one traffic demand. |
boolean |
hasLinks()
Returns
true if the network has at least one unidirectional link. |
boolean |
hasNodes()
Returns
true if the network has at least one node. |
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. |
boolean |
isEmpty()
Returns
true if the network is empty (no nodes/links/demands...). |
void |
removeAllDemands()
Removes all the demands defined within the network.
|
void |
removeAllLinks()
Removes all the links defined within the network.
|
void |
removeAllNodes()
Removes all the nodes defined within the network.
|
void |
removeAllProtectionSegments()
Removes all the protection segments defined within the network.
|
void |
removeAllRoutes()
Removes all the traffic routes defined within the network.
|
void |
removeAllSRGs()
Remove all SRGs.
|
void |
removeDemand(int demandId)
Removes the demand identified by the given parameter.
|
void |
removeDemandAttribute(int demandId,
java.lang.String key)
Removes a given attribute from a demand.
|
void |
removeDemands(int[] demandIds)
Removes a set of demands.
|
void |
removeLink(int linkId)
Removes the link identified by the given parameter.
|
void |
removeLinkAttribute(int linkId,
java.lang.String key)
Removes a given attribute from a link.
|
void |
removeLinkFromSRG(int linkId,
int srgId)
Removes a link form the set of links of a given SRG.
|
void |
removeLinks(int[] linkIds)
Removes a set of links.
|
void |
removeNetworkAttribute(java.lang.String key)
Removes a given attribute from the network.
|
void |
removeNode(int nodeId)
Removes the node identified by the given parameter.
|
void |
removeNodeAttribute(int nodeId,
java.lang.String key)
Removes a given attribute from a node.
|
void |
removeNodeFromSRG(int nodeId,
int srgId)
Removes a node form the set of links of a given SRG.
|
void |
removeNodes(int[] nodeIds)
Removes a set of nodes.
|
void |
removeProtectionSegment(int segmentId)
Removes the specified protection segment from the network.
|
void |
removeProtectionSegmentAttribute(int segmentId,
java.lang.String key)
Removes a given attribute from a segment.
|
void |
removeProtectionSegmentFromRouteBackupSegmentList(int segmentId,
int routeId)
Removes a protection segment from the list of backup protection segments of a route.
|
void |
removeProtectionSegments(int[] segmentIds)
Removes a set of protection segments.
|
void |
removeRoute(int routeId)
Removes the traffic route identified by the given parameter.
|
void |
removeRouteAttribute(int routeId,
java.lang.String key)
Removes a given attribute from a route.
|
void |
removeRoutes(int[] routeIds)
Removes a set of routes.
|
void |
removeSRG(int srgId)
Removes a SRG.
|
void |
removeSRGAttribute(int srgId,
java.lang.String key)
Removes a given attribute from a SRG.
|
void |
removeSRGs(int[] srgIds)
Removes a set of SRGs.
|
void |
reset()
Resets the network.
|
void |
saveToFile(java.io.File file)
Saves the current network plan to a given file.
|
void |
setDemandAttribute(int demandId,
java.lang.String key,
java.lang.String value)
Sets an attribute for a given demand.
|
void |
setDemandAttributes(int demandId,
java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the attributes for a given demand.
|
void |
setDemandOfferedTrafficInErlangs(int demandId,
double offeredTrafficInErlangs)
Sets the offered traffic for a given demand.
|
void |
setDemandOfferedTrafficInErlangsVector(double[] offeredTrafficInErlangs)
Sets the offered traffic for each demand.
|
void |
setLinkAttribute(int linkId,
java.lang.String key,
java.lang.String value)
Sets an attribute for a given link.
|
void |
setLinkAttributes(int linkId,
java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the attributes for a given link.
|
void |
setLinkCapacityInErlangs(int linkId,
double linkCapacity)
Sets the capacity of a link.
|
void |
setLinkLengthInKm(int linkId,
double linkLengthInKm)
Sets the length of a link.
|
void |
setNetworkAttribute(java.lang.String key,
java.lang.String value)
Sets an attribute for the network.
|
void |
setNetworkAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the network attributes.
|
void |
setNetworkDescription(java.lang.String description)
Sets the network description.
|
void |
setNetworkName(java.lang.String name)
Sets the network name.
|
void |
setNodeAttribute(int nodeId,
java.lang.String key,
java.lang.String value)
Sets an attribute for a given node.
|
void |
setNodeAttributes(int nodeId,
java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the attributes for a given node.
|
void |
setNodeName(int nodeId,
java.lang.String name)
Sets the node name.
|
void |
setNodeXYPosition(int nodeId,
double x,
double y)
Sets the node position.
|
void |
setProtectionSegmentAttribute(int segmentId,
java.lang.String key,
java.lang.String value)
Sets an attribute for a given protection segment.
|
void |
setProtectionSegmentAttributes(int segmentId,
java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the attributes for a given protection segment.
|
void |
setProtectionSegmentReservedBandwidthInErlangs(int segmentId,
double reservedBandwidthInErlangs)
Sets the reserved bandwidth for a given protection segment.
|
void |
setRouteAttribute(int routeId,
java.lang.String key,
java.lang.String value)
Sets an attribute for a given route.
|
void |
setRouteAttributes(int routeId,
java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the attributes for a given route.
|
void |
setRouteCarriedTrafficInErlangs(int routeId,
double carriedTrafficInErlangs)
Sets the carried traffic by a route.
|
void |
setSRGAttribute(int srgId,
java.lang.String key,
java.lang.String value)
Sets an attribute for a given srG.
|
void |
setSRGAttributes(int srgId,
java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the attributes for a given SRG.
|
void |
setSRGMeanTimeToFailInHours(int srgId,
double mttf)
Sets the MTTF of a given SRG.
|
void |
setSRGMeanTimeToRepairInHours(int srgId,
double mttr)
Sets the MTTR of a given SRG.
|
void |
setTrafficMatrix(double[][] trafficMatrix)
Sets the traffic demands from a given traffic matrix, removing any previous
demand.
|
java.lang.String |
toString()
Returns a String representation of the network plan.
|
NetPlan |
unmodifiableView() |
public NetPlan()
public NetPlan(java.io.File file)
.n2p
file.file
- .n2p filepublic int getRouteIngressNode(int routeId)
routeId
- Route identifierpublic int getRouteEgressNode(int routeId)
routeId
- Route identifierpublic boolean isEmpty()
true
if the network is empty (no nodes/links/demands...). It is equivalent to !hasNodes()
.true
if the network is empty, and false
otherwisepublic void removeNodes(int[] nodeIds)
nodeIds
- Node identifiersjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeLinks(int[] linkIds)
linkIds
- Link identifiersjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeDemands(int[] demandIds)
demandIds
- Demand identifiersjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeRoutes(int[] routeIds)
routeIds
- Route identifiersjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeProtectionSegments(int[] segmentIds)
segmentIds
- Protection segment identifiersjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic int[] getNodePairRoutes(int node1, int node2)
node1
- Ingress nodenode2
- Egress nodepublic int[] getNodePairBidirectionalLinks(int node1, int node2)
node1
- Node 1node2
- Node 2public int[] getNodePairLinks(int node1, int node2)
node1
- Origin nodenode2
- Destination nodepublic java.util.List<int[]> getRouteAllSequenceOfLinks()
public java.util.List<int[]> getProtectionSegmentAllSequenceOfLinks()
public void setTrafficMatrix(double[][] trafficMatrix)
Sets the traffic demands from a given traffic matrix, removing any previous demand.
Important: If there are less nodes than those in the traffic matrix as nodes as needed will be added in position (0,0).
trafficMatrix
- Traffic matrixpublic double[][] getTrafficMatrix()
public boolean[] getProtectionSegmentIsDedicatedVector()
public boolean getProtectionSegmentIsDedicated(int segmentId)
segmentId
- Protection segment identifiertrue
if the protection segment is dedicated. Otherwise, false
public double getLinkUtilization(int linkId)
linkId
- Link identifierpublic double getLinkUtilizationWithoutConsiderReservedBandwidthForProtection(int linkId)
linkId
- Link identifierpublic double getLinkMaximumUtilization()
public double getLinkMaximumUtilizationWithoutConsiderReservedBandwidthForProtection()
public double[] getLinkUtilizationVector()
public double[] getLinkUtilizationWithoutConsiderReservedBandwidthForProtectionVector()
public NetPlan unmodifiableView()
public int[] getNodePairDemands(int ingressNode, int egressNode)
ingressNode
- Ingress nodeegressNode
- Egress nodepublic double[] getLinkSpareCapacityInErlangsVector()
public double getLinkCarriedTrafficInErlangs(int linkId)
linkId
- Link identifierpublic double[] getLinkCarriedTrafficInErlangsVector()
public double getDemandCarriedTrafficInErlangs(int demandId)
demandId
- Demand identifierpublic double[] getDemandCarriedTrafficInErlangsVector()
public double[] getNodeEgressTrafficInErlangsVector()
public double[] getNodeIngressTrafficInErlangsVector()
public double[] getNodeTraversingTrafficInErlangsVector()
public void reset()
public void removeAllLinks()
Removes all the links defined within the network.
Important: All the traffic routes and protection segments will be also removed.
java.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeAllNodes()
Removes all the nodes defined within the network.
Important: All the links, traffic demands, traffic routes and protection segments will be also removed.
java.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeAllProtectionSegments()
Removes all the protection segments defined within the network.
Important: All the list of protection segments from traffic routes will be cleared.
java.lang.UnsupportedOperationException
- If network plan is not modifiablepublic double getNodePairPhysicalDistance(int nodeId1, int nodeId2)
nodeId1
- First nodenodeId2
- Second nodepublic int[] getNodeTraversingLinks(int nodeId)
nodeId
- Node identifierpublic void addDemandsFrom(NetPlan demands)
Adds to the current network plan the traffic demand set from other network plan.
Important: Any previous route will be removed.
demands
- Network plan containing a set of demandspublic NetPlan copy()
public void copyFrom(NetPlan netPlan)
NetPlan
object and copy the
information from the input NetPlan
.netPlan
- Network plan to be copiedpublic int addDemand(int ingressNodeId, int egressNodeId, double offeredTrafficInErlangs, java.util.Map<java.lang.String,java.lang.String> attributes)
Adds a new traffic demand to the network.
Important: Self-demands are not allowed.
ingressNodeId
- Node identifier of the ingress node. It must be in range [0, N-1], where N is the number of nodes defined in the networkegressNodeId
- Node identifier of the egress node. It must be in range [0, N-1], where N is the number of nodes defined in the networkofferedTrafficInErlangs
- Offered traffic by this demand measured in Erlangs. It must be greater or equal than zeroattributes
- Map for user-defined attributes. The key (String value) in the map will be the attribute name and the value (String value) will be whatever value is stored in that attribute. If null
, it will be assumed to be an empty HashMappublic int addLink(int originNodeId, int destinationNodeId, double linkCapacityInErlangs, double linkLengthInKm, java.util.Map<java.lang.String,java.lang.String> attributes) throws java.lang.UnsupportedOperationException
Adds a new link to the network.
Important: Self-links are not allowed.
originNodeId
- Node identifier of the link origin. It must be in range [0, N-1], where N is the number of nodes defined in the networkdestinationNodeId
- Node identifier of the link destination. It must be in range [0, N-1], where N is the number of nodes defined in the networklinkCapacityInErlangs
- Link capacity measured in Erlangs. It must be greater or equal than zerolinkLengthInKm
- Link length measured in Erlangs. It must be greater or equal than zero. Physical distance between node pairs can be obtained through the getPhysicalDistanceBetweenNodePair()
methodattributes
- Map for user-defined attributes. The key (String value) in the map will be the attribute name and the value (String value) will be whatever value is stored in that attribute. If null
, it will be assumed to be an empty HashMapjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic int addNode(double x, double y, java.lang.String name, java.util.Map<java.lang.String,java.lang.String> attributes)
x
- Node position in x-axisy
- Node position in y-axisname
- Node name. If null
, it will be assume to be "Node " + node identifierattributes
- Map for user-defined attributes. The key (String value) in the map will be the attribute name and the value (String value) will be whatever value is stored in that attribute. If null
, it will be assumed to be an empty HashMappublic void addRoutes(CandidatePathList cpl, double[] x_p, boolean includeUnusedRoutes)
cpl
- Candidate path listx_p
- Carried traffic per route in Erlangs. It must be greater or equal than zeroincludeUnusedRoutes
- Indicate whether routes carrying no traffic will be includedpublic int addRoute(int demandId, double carriedTrafficInErlangs, int[] sequenceOfLinks, int[] backupSegmentIds, java.util.Map<java.lang.String,java.lang.String> attributes)
demandId
- Demand identifiercarriedTrafficInErlangs
- Carried traffic by this route measured in Erlangs. It must be greater or equal than zerosequenceOfLinks
- Sequence of linksbackupSegmentIds
- Protection segment identifiers for this route. If null
, it will be assumed to be an empty arrayattributes
- Map for user-defined attributes. The key (String value) in the map will be the attribute name and the value (String value) will be whatever value is stored in that attribute. If null
, it will be assumed to be an empty HashMappublic double getProtectionSegmentPropagationDelayInSeconds(int segmentId)
segmentId
- Segment identifierpublic double[] getProtectionSegmentPropagationDelayInSecondsVector()
public double getRoutePropagationDelayInSeconds(int routeId)
routeId
- Route identifierpublic double[] getRoutePropagationDelayInSecondsVector()
public double getLinkPropagationDelayInSeconds(int linkId)
linkId
- Link identifierpublic double[] getLinkPropagationDelayInSecondsVector()
public void addProtectionSegmentToRouteBackupSegmentList(int segmentId, int routeId)
segmentId
- Segment identifierrouteId
- Route identifierpublic void setRouteCarriedTrafficInErlangs(int routeId, double carriedTrafficInErlangs)
routeId
- Route identifiercarriedTrafficInErlangs
- Carried traffic in Erlangspublic int addProtectionSegment(int[] sequenceOfLinks, double reservedBandwidthInErlangs, java.util.Map<java.lang.String,java.lang.String> attributes)
addProtectionSegmentToRouteBackupSegmentList()
method must be used.sequenceOfLinks
- Sequence of linksreservedBandwidthInErlangs
- Reserved bandwidth in Erlangsattributes
- Map for user-defined attributes. The key (String value) in the map will be the attribute name and the value (String value) will be whatever value is stored in that attribute. If null
, it will be assumed to be an empty HashMappublic void checkValidity(java.util.Map<java.lang.String,java.lang.String> net2planParameters, boolean allowLinkOversubscription, boolean allowExcessCarriedTraffic)
public java.lang.String[] checkValidityAndWarnings(java.util.Map<java.lang.String,java.lang.String> net2planParameters, boolean allowLinkOversubscription, boolean allowExcessCarriedTraffic)
net2planParameters
- A key-value map with Net2Plan
-wide configuration optionsallowLinkOversubscription
- true
if link capacity constraint may be violated. Otherwise, false
allowExcessCarriedTraffic
- true
if carried traffic may be greater than the offered one for some demand. Otherwise, false
public void checkRouteValidityForDemand(int[] sequenceOfLinks, int demandId)
demandId
- Demand identifiersequenceOfLinks
- Sequence of linkspublic java.lang.String getDemandAttribute(int demandId, java.lang.String key)
null
value will be returneddemandId
- Demand identifierkey
- Attribute namepublic java.lang.String[] getDemandAttributeVector(java.lang.String key)
key
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getDemandSpecificAttributes(int demandId)
demandId
- Demand identifierpublic int getDemandEgressNode(int demandId)
demandId
- Demand identifierpublic int[] getDemandEgressNodeVector()
public int getDemandIngressNode(int demandId)
demandId
- Demand identifierpublic int[] getDemandIngressNodeVector()
public double getDemandOfferedTrafficInErlangs(int demandId)
demandId
- Demand identifierpublic double[] getDemandOfferedTrafficInErlangsVector()
public int[][] getDemandTable()
public double[][] getPhysicalDistanceMatrix()
public java.lang.String getLinkAttribute(int linkId, java.lang.String key)
linkId
- Link identifierkey
- Attribute namepublic java.lang.String[] getLinkAttributeVector(java.lang.String key)
key
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getLinkSpecificAttributes(int linkId)
linkId
- Link identifierpublic double getLinkCapacityInErlangs(int linkId)
linkId
- Link identifierpublic double getLinkCapacityReservedForProtectionInErlangs(int linkId)
linkId
- Link identifierpublic double[] getLinkCapacityReservedForProtectionInErlangsVector()
public double getLinkCapacityNotReservedForProtectionInErlangs(int linkId)
linkId
- Link identifierpublic double[] getLinkCapacityNotReservedForProtectionInErlangsVector()
public double[] getLinkCapacityInErlangsVector()
public int getLinkDestinationNode(int linkId)
linkId
- Link identifierpublic double getLinkLengthInKm(int linkId)
linkId
- Link identifierpublic double[] getLinkLengthInKmVector()
public int getLinkOriginNode(int linkId)
linkId
- Link identifierpublic int[][] getLinkTable()
public java.lang.String getNetworkAttribute(java.lang.String key)
key
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getNetworkAttributes()
public java.lang.String getNetworkDescription()
public java.lang.String getNetworkName()
public java.lang.String getNodeAttribute(int nodeId, java.lang.String key)
nodeId
- Node identifierkey
- Attribute namepublic java.lang.String[] getNodeAttributeVector(java.lang.String key)
key
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getNodeSpecificAttributes(int nodeId)
nodeId
- Node identifierpublic int[] getNodeOutgoingRoutes(int nodeId)
nodeId
- Node identifierspublic int[] getNodeIncomingRoutes(int nodeId)
nodeId
- Node identifierspublic int[] getNodeIncomingDemands(int nodeId)
nodeId
- Node identifierspublic int[] getNodeIncomingLinks(int nodeId)
nodeId
- Node identifierspublic int[] getNodeOutgoingDemands(int nodeId)
nodeId
- Node identifierspublic java.lang.String getNodeName(int nodeId)
nodeId
- Node identifierpublic java.lang.String[] getNodeNames(int[] nodeIds)
nodeIds
- Node identifierspublic java.lang.String[] getNodeNameVector()
public int[] getNodeOutgoingLinks(int nodeId)
nodeId
- Node identifierspublic double[] getNodeXYPosition(int nodeId)
nodeId
- Node identifierpublic double[][] getNodeXYPositionTable()
public int getNumberOfDemands()
public int getNumberOfLinks()
public int getNumberOfNodes()
public int getNumberOfRoutes()
public int getNumberOfProtectionSegments()
public java.lang.String getRouteAttribute(int routeId, java.lang.String key)
routeId
- Route identifierkey
- Attribute namepublic java.lang.String[] getRouteAttributeVector(java.lang.String key)
key
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getRouteSpecificAttributes(int routeId)
routeId
- Route identifierpublic int[] getRouteBackupSegmentList(int routeId)
routeId
- Route identifierpublic int getRouteDemand(int routeId)
routeId
- Route identifierpublic int[] getRouteDemandVector()
public int[] getDemandRoutes(int demandId)
demandId
- Demand identifierpublic double getRouteCarriedTrafficInErlangs(int routeId)
routeId
- Route identifierpublic double getProtectionSegmentLengthInKm(int segmentId)
segmentId
- Protection segment identifierpublic double[] getProtectionSegmentLengthInKmVector()
public int getProtectionSegmentNumberOfHops(int segmentId)
segmentId
- Protection segment identifierpublic int[] getProtectionSegmentNumberOfHopsVector()
public double getRouteLengthInKm(int routeId)
routeId
- Route identifierpublic double[] getRouteLengthInKmVector()
public int getRouteNumberOfHops(int routeId)
routeId
- Route identifierpublic int[] getRouteNumberOfHopsVector()
public double[] getRouteCarriedTrafficFractionVector()
public double[] getRouteCarriedTrafficInErlangsVector()
public int[] getRouteSequenceOfLinks(int routeId)
routeId
- Route identifierpublic int[] getRouteSequenceOfNodes(int routeId)
routeId
- Route identifierpublic int[] getLinkTraversingRoutes(int linkId)
linkId
- Link identifierpublic java.lang.String getProtectionSegmentAttribute(int segmentId, java.lang.String key)
segmentId
- Protection segment identifierkey
- Attribute namepublic java.lang.String[] getProtectionSegmentAttributeVector(java.lang.String key)
key
- Attribute namepublic java.util.Map<java.lang.String,java.lang.String> getProtectionSegmentSpecificAttributes(int segmentId)
segmentId
- Segment identifierpublic int getProtectionSegmentDestinationNode(int segmentId)
segmentId
- Segment identifierpublic int getProtectionSegmentOriginNode(int segmentId)
segmentId
- Segment identifierpublic double getProtectionSegmentReservedBandwidthInErlangs(int segmentId)
segmentId
- Protection segment identifierpublic double[] getProtectionSegmentReservedBandwithInErlangsVector()
public int[] getProtectionSegmentRoutes(int segmentId)
segmentId
- Protection segment identifierpublic int[] getProtectionSegmentSequenceOfLinks(int segmentId)
segmentId
- Protection segment identifierpublic int[] getProtectionSegmentSequenceOfNodes(int segmentId)
segmentId
- Protection segment identifierpublic int[] getLinkTraversingProtectionSegments(int linkId)
linkId
- Link identifierpublic int[] getNodeTraversingRoutes(int nodeId)
nodeId
- Node identifierpublic int[] getNodeTraversingProtectionSegments(int nodeId)
nodeId
- Node identifierpublic boolean hasDemands()
true
if the network has at least one traffic demand. It is equivalent to getNumberOfDemands()
> 0
.true
if there are traffic demands defined for the network, and false
otherwisepublic 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 hasNodes()
true
if the network has at least one node. It is equivalent to getNumberOfNodes()
> 0
.true
if there are nodes 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(int routeId, int segmentId)
segmentId
- Segment identifierrouteId
- Route identifiertrue
is segment is applicable to route, false
otherwisepublic void removeAllDemands()
Removes all the demands defined within the network.
Important: All the traffic routes will be also removed.
java.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeAllRoutes()
java.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeProtectionSegmentFromRouteBackupSegmentList(int segmentId, int routeId)
segmentId
- Segment identifierrouteId
- Route identifierpublic void removeDemand(int demandId)
Removes the demand identified by the given parameter.
Important: Any route carrying traffic from that demand will be also removed.
demandId
- Identifier of the demand to be removedjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeDemandAttribute(int demandId, java.lang.String key)
demandId
- Route identifierkey
- Attribute namejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeLink(int linkId)
Removes the link identified by the given parameter.
Important: Any route or protection segment traversing that link will be also removed.
linkId
- Identifier of the link to be removedjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeLinkAttribute(int linkId, java.lang.String key)
linkId
- Link identifierkey
- Attribute namejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeNetworkAttribute(java.lang.String key)
key
- Attribute namejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeNode(int nodeId)
Removes the node identified by the given parameter.
Important: Any link or demand referring to that node will be also removed.
nodeId
- Identifier of the node to be removedjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeNodeAttribute(int nodeId, java.lang.String key)
nodeId
- Node identifierkey
- Attribute namejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeRoute(int routeId)
routeId
- Identifier of the route to be removedjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeRouteAttribute(int routeId, java.lang.String key)
routeId
- Route identifierkey
- Attribute namejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeProtectionSegment(int segmentId)
Removes the specified protection segment from the network.
Important: That segment will be removed from the list of protection segments of any associated route.
segmentId
- Identifier of the protection segment to be removedjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void removeProtectionSegmentAttribute(int segmentId, java.lang.String key)
segmentId
- Segment identifierkey
- Attribute namejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void saveToFile(java.io.File file)
file
- .n2p filepublic int[] convertSequenceOfLinks2SequenceOfNodes(int[] sequenceOfLinksAndSegments)
sequenceOfLinksAndSegments
- Sequence of links and segmentspublic void setDemandAttribute(int demandId, java.lang.String key, java.lang.String value)
demandId
- Demand identifierkey
- Attribute namevalue
- Attribute valuejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setDemandAttributes(int demandId, java.util.Map<java.lang.String,java.lang.String> attributes)
demandId
- Demand identifierattributes
- Map of attributesjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setDemandOfferedTrafficInErlangs(int demandId, double offeredTrafficInErlangs)
demandId
- Demand identifierofferedTrafficInErlangs
- Offered traffic in Erlangsjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setDemandOfferedTrafficInErlangsVector(double[] offeredTrafficInErlangs)
offeredTrafficInErlangs
- Offered traffic in Erlangsjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setLinkAttribute(int linkId, java.lang.String key, java.lang.String value)
linkId
- Link identifierkey
- Attribute namevalue
- Attribute valuejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setLinkAttributes(int linkId, java.util.Map<java.lang.String,java.lang.String> attributes)
linkId
- Link identifierattributes
- Map of attributesjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setLinkCapacityInErlangs(int linkId, double linkCapacity)
linkId
- Link identifierlinkCapacity
- Link capacity in Erlangsjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setLinkLengthInKm(int linkId, double linkLengthInKm)
linkId
- Link identifierlinkLengthInKm
- Link length measured in Erlangs. It must be greater or equal than zero. Physical distance between node pairs can be obtained through the getPhysicalDistanceBetweenNodePair()
methodjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setNetworkAttribute(java.lang.String key, java.lang.String value)
key
- Attribute namevalue
- Attribute valuejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setNetworkAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
attributes
- Map of attributesjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setNetworkDescription(java.lang.String description)
description
- Network descriptionpublic void setNetworkName(java.lang.String name)
name
- Network namepublic void setNodeAttribute(int nodeId, java.lang.String key, java.lang.String value)
nodeId
- Node identifierkey
- Attribute namevalue
- Attribute valuejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setNodeAttributes(int nodeId, java.util.Map<java.lang.String,java.lang.String> attributes)
nodeId
- Node identifierattributes
- Map of attributesjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setNodeName(int nodeId, java.lang.String name)
nodeId
- Node identifiername
- New namejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setNodeXYPosition(int nodeId, double x, double y)
nodeId
- Node identifierx
- Node position in x-axisy
- Node position in y-axisjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setRouteAttribute(int routeId, java.lang.String key, java.lang.String value)
routeId
- Route identifierkey
- Attribute namevalue
- Attribute valuejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setRouteAttributes(int routeId, java.util.Map<java.lang.String,java.lang.String> attributes)
routeId
- Route identifierattributes
- Map of attributesjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setProtectionSegmentAttribute(int segmentId, java.lang.String key, java.lang.String value)
segmentId
- Protection segment identifierkey
- Attribute namevalue
- Attribute valuejava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void setProtectionSegmentAttributes(int segmentId, java.util.Map<java.lang.String,java.lang.String> attributes)
segmentId
- Protection segment identifierattributes
- Map of attributespublic void setProtectionSegmentReservedBandwidthInErlangs(int segmentId, double reservedBandwidthInErlangs)
segmentId
- Protection segment idreservedBandwidthInErlangs
- Reserved bandwidth in Erlangsjava.lang.UnsupportedOperationException
- If network plan is not modifiablepublic void addLinkToSRG(int linkId, int srgId)
linkId
- Link identifiersrgId
- SRG identifierpublic void addNodeToSRG(int nodeId, int srgId)
nodeId
- Node identifiersrgId
- SRG identifierpublic int addSRG(int[] nodeIds, int[] linkIds, double mttf, double mttr, java.util.Map<java.lang.String,java.lang.String> attributes)
nodeIds
- Set of node identifierslinkIds
- Set of link identifiersmttf
- Mean Time To Fail (in hours). Zero or negative value means Double.MAX_VALUE
mttr
- Mean Time To Repair (in hours). Zero or negative value are not allowedattributes
- Map for user-defined attributes. The key (String value) in the map will be the attribute name and the value (String value) will be whatever value is stored in that attribute. If null, it will be assumed to be an empty HashMappublic int[] getLinkSRGs(int linkId)
linkId
- Link identifierpublic int[][] getLinkSRGsVector()
public int[] getNodeSRGs(int nodeId)
nodeId
- Node identifierpublic int[][] getNodeSRGsVector()
public int[] getProtectionSegmentSRGs(int segmentId)
segmentId
- Segment identifierpublic int[] getRouteSRGs(int routeId)
routeId
- Route identifierpublic int getNumberOfSRGs()
public java.lang.String getSRGAttribute(int srgId, java.lang.String key)
srgId
- SRG identifierkey
- Attribute namepublic java.lang.String[] getSRGAttributeVector(java.lang.String key)
key
- Attribute namepublic double getSRGAvailability(int srgId)
srgId
- SRG identifierpublic double[] getSRGAvailabilityVector()
public int[] getSRGLinks(int srgId)
srgId
- SRG identifierpublic int[][] getSRGLinksVector()
public double getSRGMeanTimeToFailInHours(int srgId)
srgId
- SRG identifierpublic double[] getSRGMeanTimeToFailInHoursVector()
public double getSRGMeanTimeToRepairInHours(int srgId)
srgId
- SRG identifierpublic double[] getSRGMeanTimeToRepairInHoursVector()
public int[] getSRGNodes(int srgId)
srgId
- SRG identifierpublic int[][] getSRGNodesVector()
public int[] getSRGProtectionSegments(int srgId)
srgId
- SRG identifierpublic int[] getSRGRoutes(int srgId)
srgId
- SRG identifierpublic java.util.Map<java.lang.String,java.lang.String> getSRGSpecificAttributes(int 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 void removeLinkFromSRG(int linkId, int srgId)
linkId
- Link identifiersrgId
- SRG identifierpublic void removeNodeFromSRG(int nodeId, int srgId)
nodeId
- Node identifiersrgId
- SRG identifierpublic void removeSRG(int srgId)
srgId
- SRG identifierpublic void removeSRGs(int[] srgIds)
srgIds
- Set of SRG identifierspublic void removeSRGAttribute(int srgId, java.lang.String key)
srgId
- SRG identifierkey
- Attribute namepublic void removeAllSRGs()
public void setSRGAttribute(int srgId, java.lang.String key, java.lang.String value)
srgId
- SRG identifierkey
- Attribute namevalue
- Attribute valuepublic void setSRGAttributes(int srgId, java.util.Map<java.lang.String,java.lang.String> attributes)
srgId
- SRG identifierattributes
- Map of attributespublic void setSRGMeanTimeToFailInHours(int srgId, double mttf)
srgId
- SRG identifiermttf
- Mean Time To Fail (in hours). Zero or negative value means Double.MAX_VALUE
public void setSRGMeanTimeToRepairInHours(int srgId, double mttr)
srgId
- SRG identifiermttr
- Mean Time To Repair (in hours). Zero or negative value are not allowedpublic java.lang.String toString()