public class TrafficAllocationAction
extends 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 constructor used to get an instance. Take a look
on the description of the constructors 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 netPlan.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.
Modifier and Type | Class and Description |
---|---|
static class |
TrafficAllocationAction.ActionType
Type of action.
|
Constructor and Description |
---|
TrafficAllocationAction(double reservedBandwidthInErlangs,
int[] sequenceOfLinks,
Map<String,String> attributes)
Constructor to define an 'add protection segment' action.
|
TrafficAllocationAction(int demandId,
double trafficVolumeInErlangs,
int[] sequenceOfLinks,
int[] backupSegments,
Map<String,String> attributes)
Constructor to define an 'add route' action.
|
TrafficAllocationAction(int originNodeId,
int destinationNodeId,
double capacityInErlangs,
double lengthInKm,
Map<String,String> attributes)
Constructor to define an 'add link' action.
|
TrafficAllocationAction(TrafficAllocationAction.ActionType type,
int id)
Constructor to define a 'remove link/protection segment/route' action.
|
TrafficAllocationAction(TrafficAllocationAction.ActionType type,
int id,
double erlangs)
Constructor to define a 'modify link/protection segment/route' action.
|
Modifier and Type | Method and Description |
---|---|
TrafficAllocationAction.ActionType |
getActionType()
Returns the action type.
|
Map<String,String> |
getAddLinkAttributes()
Returns the attributes for the new link.
|
double |
getAddLinkCapacityInErlangs()
Returns the capacity for the new link.
|
int |
getAddLinkDestinationNode()
Returns the destination node identifier for the new link.
|
double |
getAddLinkLengthInKm()
Returns the length for the new link.
|
int |
getAddLinkOriginNode()
Returns the origin node identifier for the new link.
|
Map<String,String> |
getAddProtectionSegmentAttributes()
Returns the attributes for the new protection segment.
|
double |
getAddProtectionSegmentReservedBandwidthInErlangs()
Returns the reserved bandwidth for the new protection segment.
|
int[] |
getAddProtectionSegmentSequenceOfLinks()
Returns the sequence of links for the new protection segment.
|
Map<String,String> |
getAddRouteAttributes()
Returns the attributes for the new route.
|
int[] |
getAddRouteBackupSegments()
Returns the list of backup segments for the new route.
|
int |
getAddRouteDemand()
Returns the demand identifier for the new route.
|
int[] |
getAddRouteSequenceOfLinks()
Returns the sequence of links for the new route.
|
double |
getAddRouteTrafficVolumeInErlangs()
Returns the traffic volume for the new route.
|
double |
getModifyLinkCapacityInErlangs()
Returns the new capacity value for the link.
|
int |
getModifyLinkId()
Returns the identifier of the link to be modified.
|
int |
getModifyProtectionSegmentId()
Returns the identifier of the protection segment to be modified.
|
double |
getModifyProtectionSegmentReservedBandwidthInErlangs()
Returns the new reserved bandwidth for the protection segment.
|
int |
getModifyRouteId()
Returns the identifier of the route to be modified.
|
double |
getModifyRouteTrafficVolumeInErlangs()
Returns the new traffic volume for the route.
|
int |
getRemoveLinkId()
Returns the identifier of the link to be removed.
|
int |
getRemoveProtectionSegmentId()
Returns the identifier of the protection segment to be removed.
|
int |
getRemoveRouteId()
Returns the identifier of the route to be removed.
|
String |
toString()
Returns a
String representation of the object. |
public TrafficAllocationAction(int originNodeId, int destinationNodeId, double capacityInErlangs, double lengthInKm, Map<String,String> attributes)
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 networkcapacityInErlangs
- Link capacity measured in Erlangs. It must be greater or equal than zerolengthInKm
- 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 HashMappublic TrafficAllocationAction(double reservedBandwidthInErlangs, int[] sequenceOfLinks, Map<String,String> attributes)
reservedBandwidthInErlangs
- Reserved bandwidth in ErlangssequenceOfLinks
- Sequence of linksattributes
- 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 TrafficAllocationAction(int demandId, double trafficVolumeInErlangs, int[] sequenceOfLinks, int[] backupSegments, Map<String,String> attributes)
demandId
- Demand identifiertrafficVolumeInErlangs
- Carried traffic by this route measured in Erlangs. It must be greater or equal than zerosequenceOfLinks
- Sequence of linksbackupSegments
- 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 TrafficAllocationAction(TrafficAllocationAction.ActionType type, int id)
type
- Action type (remove link/protection segment/route)id
- Element identifierpublic TrafficAllocationAction(TrafficAllocationAction.ActionType type, int id, double erlangs)
type
- Action type (modify link/protection segment/route)id
- Element identifiererlangs
- Link capacity (for 'modify link' action), Reserved bandwidth (for 'modify protection segment' action), or Traffic volume (for 'modify route' action)public int getAddLinkOriginNode()
public int getAddLinkDestinationNode()
public double getAddLinkCapacityInErlangs()
public double getAddLinkLengthInKm()
public Map<String,String> getAddLinkAttributes()
public double getAddProtectionSegmentReservedBandwidthInErlangs()
public int[] getAddProtectionSegmentSequenceOfLinks()
public Map<String,String> getAddProtectionSegmentAttributes()
public int getAddRouteDemand()
public double getAddRouteTrafficVolumeInErlangs()
public int[] getAddRouteSequenceOfLinks()
public int[] getAddRouteBackupSegments()
public Map<String,String> getAddRouteAttributes()
public int getModifyLinkId()
public double getModifyLinkCapacityInErlangs()
public int getModifyRouteId()
public double getModifyRouteTrafficVolumeInErlangs()
public int getModifyProtectionSegmentId()
public double getModifyProtectionSegmentReservedBandwidthInErlangs()
public int getRemoveLinkId()
public int getRemoveRouteId()
public int getRemoveProtectionSegmentId()
public TrafficAllocationAction.ActionType getActionType()
public String toString()
String
representation of the object.toString
in class Object
String
representation of the object