public class TrafficAllocationAction
extends java.lang.Object
Provides a set of actions to be returned by allocation algorithms. These actions are:
Although the TrafficAllocationAction
class is common for all actions, its meaning (i.e.
action type) depends on the static method used to get an instance. Take a look
on the description of the static methods to obtain more information.
Important: Actions don't take effect within the algorithm. This means,
for example, that if you remove a link, methods like netState.getNumberOfLinks()
will return
the previous value including that link, instead of the current according
to the actions. Network state is actually modified by the kernel after
the execution of the algorithm, so users should deal with current network state
by their own.
Important: Identifiers for new elements (i.e. link, route, protection segment,
SRG) follow an incremental scheme, and no index is reused when some element is removed.
The (first) next identifier of each element can be accessed via netState.getNextXXXId())
method.
Modifier and Type | Class and Description |
---|---|
static class |
TrafficAllocationAction.ActionType
Type of action.
|
Modifier and Type | Method and Description |
---|---|
static TrafficAllocationAction |
addLink(int originNodeId,
int destinationNodeId,
double linkCapacityInErlangs,
double linkLengthInKm,
java.util.Map<java.lang.String,java.lang.String> attributes)
'Add link' action.
|
static TrafficAllocationAction |
addLinkToSRG(long linkId,
long srgId)
'Add link to SRG' action.
|
static TrafficAllocationAction |
addNodeToSRG(int nodeId,
long srgId)
'Add node to SRG' action.
|
static TrafficAllocationAction |
addProtectionSegment(long[] seqLinks,
double reservedBandwidthInErlangs,
java.util.Map<java.lang.String,java.lang.String> attributes)
'Add protection segment' action.
|
static TrafficAllocationAction |
addProtectionSegmentTosRouteBackupSegmentList(long segmentId,
long routeId)
'Add protection segment to route backup list' action.
|
static TrafficAllocationAction |
addRoute(int demandId,
double trafficVolumeInErlangs,
long[] seqLinks,
long[] backupSegmentList,
java.util.Map<java.lang.String,java.lang.String> attributes)
'Add route' action.
|
static TrafficAllocationAction |
addSRG(int[] nodeIds,
long[] linkIds,
double mttf,
double mttr,
java.util.Map<java.lang.String,java.lang.String> attributes)
'Add SRG' action.
|
TrafficAllocationAction.ActionType |
getActionType()
Returns the action type.
|
static TrafficAllocationAction |
modifyLink(long linkId,
double linkCapacityInErlangs,
double linkLengthInKm,
java.util.Map<java.lang.String,java.lang.String> attributes)
'Modify link' action.
|
static TrafficAllocationAction |
modifyProtectionSegment(long segmentId,
double reservedBandwidthInErlangs,
java.util.Map<java.lang.String,java.lang.String> attributes)
'Modify protection segment' action.
|
static TrafficAllocationAction |
modifyRoute(long routeId,
double trafficVolumeInErlangs,
java.util.Map<java.lang.String,java.lang.String> attributes)
'Modify route' action.
|
static TrafficAllocationAction |
modifySRG(long srgId,
double mttf,
double mttr,
java.util.Map<java.lang.String,java.lang.String> attributes)
'Modify SRG' action.
|
static TrafficAllocationAction |
removeAllLinks()
'Remove all links' action.
|
static TrafficAllocationAction |
removeAllProtectionSegments()
'Remove all protection segments' action.
|
static TrafficAllocationAction |
removeAllProtectionSegmentsFromRouteBackupList(long routeId)
'Remove all protection segments from route backup list' action.
|
static TrafficAllocationAction |
removeAllRoutes()
'Remove all routes' action.
|
static TrafficAllocationAction |
removeAllSRGs()
'Remove all SRGs' action.
|
static TrafficAllocationAction |
removeLink(long linkId)
'Remove link' action.
|
static TrafficAllocationAction |
removeLinkFromSRG(long linkId,
long srgId)
'Remove link from SRG' action.
|
static TrafficAllocationAction |
removeNodeFromSRG(int nodeId,
long srgId)
'Remove node from SRG' action.
|
static TrafficAllocationAction |
removeProtectionSegment(long segmentId)
'Remove protection segment' action.
|
static TrafficAllocationAction |
removeProtectionSegmentFromRouteBackupSegmentList(long segmentId,
long routeId)
'Remove protection segment from route backup list' action.
|
static TrafficAllocationAction |
removeRoute(long routeId)
'Remove route' action.
|
static TrafficAllocationAction |
removeSRG(long srgId)
'Remove SRG' action.
|
java.lang.String |
toString()
Returns a
String representation of the object. |
public static TrafficAllocationAction addLink(int originNodeId, int destinationNodeId, double linkCapacityInErlangs, double linkLengthInKm, java.util.Map<java.lang.String,java.lang.String> attributes)
originNodeId
- Origin node identifierdestinationNodeId
- Destination node identifierlinkCapacityInErlangs
- Link capacity in ErlangslinkLengthInKm
- Link length in kmattributes
- Attributes (null means empty)public static TrafficAllocationAction addLinkToSRG(long linkId, long srgId)
linkId
- Link identifiersrgId
- SRG identifierpublic static TrafficAllocationAction addNodeToSRG(int nodeId, long srgId)
nodeId
- Node identifiersrgId
- SRG identifierpublic static TrafficAllocationAction addProtectionSegment(long[] seqLinks, double reservedBandwidthInErlangs, java.util.Map<java.lang.String,java.lang.String> attributes)
seqLinks
- Sequence of linksreservedBandwidthInErlangs
- Reserved bandwidth in Erlangsattributes
- Attributes (null means empty)public static TrafficAllocationAction addProtectionSegmentTosRouteBackupSegmentList(long segmentId, long routeId)
segmentId
- Protection segment identifierrouteId
- Route identifierpublic static TrafficAllocationAction addRoute(int demandId, double trafficVolumeInErlangs, long[] seqLinks, long[] backupSegmentList, java.util.Map<java.lang.String,java.lang.String> attributes)
demandId
- Demand identifiertrafficVolumeInErlangs
- Carried traffic in ErlangsseqLinks
- Sequence of linksbackupSegmentList
- Backup segment list (null means empty)attributes
- Attributes (null means empty)public static TrafficAllocationAction addSRG(int[] nodeIds, long[] linkIds, double mttf, double mttr, java.util.Map<java.lang.String,java.lang.String> attributes)
nodeIds
- Node identifiers (null means empty)linkIds
- Link identifiers (null means empty)mttf
- Mean time to fail in hoursmttr
- Mean time to repair in hoursattributes
- Attributes (null means empty)public static TrafficAllocationAction modifyLink(long linkId, double linkCapacityInErlangs, double linkLengthInKm, java.util.Map<java.lang.String,java.lang.String> attributes)
linkId
- Link identifierlinkCapacityInErlangs
- Link capacity in Erlangs (-1 means 'no change')linkLengthInKm
- Link length in km (-1 means 'no change')attributes
- New attributes (null means 'no change')public static TrafficAllocationAction modifyProtectionSegment(long segmentId, double reservedBandwidthInErlangs, java.util.Map<java.lang.String,java.lang.String> attributes)
segmentId
- Protection segment identifierreservedBandwidthInErlangs
- Reserved bandwidth in Erlangs (-1 means 'no change')attributes
- New attributes (null means 'no change')public static TrafficAllocationAction modifyRoute(long routeId, double trafficVolumeInErlangs, java.util.Map<java.lang.String,java.lang.String> attributes)
routeId
- Route identifiertrafficVolumeInErlangs
- Carried traffic in Erlangs (-1 means 'no change')attributes
- New attributes (null means 'no change')public static TrafficAllocationAction modifySRG(long srgId, double mttf, double mttr, java.util.Map<java.lang.String,java.lang.String> attributes)
srgId
- SRG identifiermttf
- Mean time to fail in hours (-1 means 'no change')mttr
- Mean time to repair in hours (-1 means 'no change')attributes
- New attributes (null means 'no change')public static TrafficAllocationAction removeAllLinks()
public static TrafficAllocationAction removeAllProtectionSegments()
public static TrafficAllocationAction removeAllProtectionSegmentsFromRouteBackupList(long routeId)
routeId
- Route identifierpublic static TrafficAllocationAction removeAllRoutes()
public static TrafficAllocationAction removeAllSRGs()
public static TrafficAllocationAction removeLink(long linkId)
linkId
- Link identifierpublic static TrafficAllocationAction removeLinkFromSRG(long linkId, long srgId)
linkId
- Link identifiersrgId
- SRG identifierpublic static TrafficAllocationAction removeNodeFromSRG(int nodeId, long srgId)
nodeId
- Node identifiersrgId
- SRG identifierpublic static TrafficAllocationAction removeProtectionSegment(long segmentId)
segmentId
- Protection segment identifierpublic static TrafficAllocationAction removeProtectionSegmentFromRouteBackupSegmentList(long segmentId, long routeId)
segmentId
- Protection segment identifierrouteId
- Route identifierpublic static TrafficAllocationAction removeRoute(long routeId)
routeId
- Route identifierpublic static TrafficAllocationAction removeSRG(long srgId)
srgId
- SRG identifierpublic TrafficAllocationAction.ActionType getActionType()
public java.lang.String toString()
String
representation of the object.toString
in class java.lang.Object
String
representation of the object