public class WDMUtils
extends Object
Modifier and Type | Class and Description |
---|---|
static class |
WDMUtils.WavelengthOccupancyTransformer
Fiber-to-weight transformer for shortest path algorithms which returns
Double.MAX_VALUE for already-occupied fibers, and the associated
weight otherwise. |
Modifier and Type | Field and Description |
---|---|
static String |
SEQUENCE_OF_REGENERATORS_ATTRIBUTE_NAME
Route/protection segment attribute name for sequence of regenerators.
|
static String |
SEQUENCE_OF_WAVELENGTHS_ATTRIBUTE_NAME
Route/protection segment attribute name for sequence of wavelengths.
|
Modifier and Type | Method and Description |
---|---|
static void |
allocateResources(List<Long> seqFibers,
int[] seqWavelengths,
List<Set<Long>> wavelengthFiberOccupancy)
Updates
wavelengthFiberOccupancy to consider that a new lightpath is occupying
a wavelength in each fiber. |
static void |
allocateResources(List<Long> seqFibers,
int wavelengthId,
List<Set<Long>> wavelengthFiberOccupancy)
Updates
wavelengthFiberOccupancy to consider that a new lightpath is occupying
a wavelength in each fiber. |
static void |
allocateResources(Map<Long,Pair<Long,Long>> fiberMap,
List<Long> seqFibers,
int[] seqWavelengths,
List<Set<Long>> wavelengthFiberOccupancy,
int[] seqRegenerators,
Map<Long,Integer> nodeRegeneratorOccupancy)
Updates
wavelengthFiberOccupancy to consider that a new lightpath is occupying
a wavelength in each fiber. |
static void |
allocateResources(Map<Long,Pair<Long,Long>> fiberMap,
List<Long> seqFibers,
int wavelengthId,
List<Set<Long>> wavelengthFiberOccupancy,
int[] seqRegenerators,
Map<Long,Integer> nodeRegeneratorOccupancy)
Updates
wavelengthFiberOccupancy to consider that a new lightpath is occupying
a wavelength in each fiber. |
static void |
checkConsistency(NetPlan netPlan)
Performs extra checks to those applicable to every network design, especially
focused on WDM networks.
|
static void |
checkConsistency(NetPlan netPlan,
long layerId)
Performs extra checks to those applicable to every network design, especially
focused on WDM networks.
|
static int[] |
computeRegeneratorPositions(Map<Long,Pair<Long,Long>> fiberMap,
List<Long> seqFibers,
int[] seqWavelengths,
Map<Long,Double> l_f,
double maxRegeneratorDistanceInKm)
Returns the list of nodes within the lightpath route containing a regenerator,
only following a distance criterium, assuming wavelength conversion is required.
|
static int[] |
computeRegeneratorPositions(Map<Long,Pair<Long,Long>> fiberMap,
List<Long> seqFibers,
Map<Long,Double> l_f,
double maxRegeneratorDistanceInKm)
Returns the list of nodes within the lightpath route containing a regenerator,
only following a distance criterium, assuming no wavelength conversion is required.
|
static int |
getFiberNumWavelengths(NetPlan netPlan,
long fiberId)
Returns the number of wavelengths for the given fiber.
|
static int |
getFiberNumWavelengths(NetPlan netPlan,
long layerId,
long fiberId)
Returns the number of wavelengths for the given fiber.
|
static Map<Long,Integer> |
getFiberNumWavelengthsMap(NetPlan netPlan)
Returns the total number of wavelengths in each fiber.
|
static Map<Long,Integer> |
getFiberNumWavelengthsMap(NetPlan netPlan,
long layerId)
Returns the total number of wavelengths in each fiber.
|
static int[] |
getFiberNumWavelengthsVector(NetPlan netPlan)
Returns the total number of wavelengths in each fiber, where item 0 corresponds
to first fiber in the network, item 1 to the second one, and so on.
|
static int[] |
getFiberNumWavelengthsVector(NetPlan netPlan,
long layerId)
Returns the total number of wavelengths in each fiber, where item 0 corresponds
to first fiber in the network, item 1 to the second one, and so on.
|
static Map<Long,Set<Integer>> |
getFiberWavelengthOccupancyMap(NetPlan netPlan)
Returns the set of used wavelengths per fiber.
|
static Map<Long,Set<Integer>> |
getFiberWavelengthOccupancyMap(NetPlan netPlan,
long layerId)
Returns the set of used wavelengths per fiber.
|
static int[] |
getLightpathSeqRegenerators(NetPlan netPlan,
long lightpathId)
Returns the sequence of regenerators/wavelength converters for the given lightpath.
|
static int[] |
getLightpathSeqRegenerators(NetPlan netPlan,
long layerId,
long lightpathId)
Returns the sequence of regenerators/wavelength converters for the given lightpath.
|
static int[] |
getLightpathSeqWavelengths(NetPlan netPlan,
long lightpathId)
Returns the sequence of wavelengths for the given lightpath.
|
static int[] |
getLightpathSeqWavelengths(NetPlan netPlan,
long layerId,
long lightpathId)
Returns the sequence of wavelengths for the given lightpath.
|
static Map<Long,Integer> |
getNodeRegeneratorOccupancyMap(NetPlan netPlan)
Returns the number of regenerators installed per node.
|
static Map<Long,Integer> |
getNodeRegeneratorOccupancyMap(NetPlan netPlan,
long layerId)
Returns the number of regenerators installed per node.
|
static int[] |
getProtectionLightpathSeqRegenerators(NetPlan netPlan,
long protectionLightpathId)
Returns the sequence of regenerators/wavelength converters for the given lightpath.
|
static int[] |
getProtectionLightpathSeqRegenerators(NetPlan netPlan,
long layerId,
long protectionLightpathId)
Returns the sequence of regenerators/wavelength converters for the given lightpath.
|
static int[] |
getProtectionLightpathSeqWavelengths(NetPlan netPlan,
long protectionLightpathId)
Returns the sequence of wavelengths for a given protection lightpath.
|
static int[] |
getProtectionLightpathSeqWavelengths(NetPlan netPlan,
long layerId,
long protectionLightpathId)
Returns the sequence of wavelengths for a given protection lightpath.
|
static List<Set<Long>> |
getWavelengthFiberOccupancy(NetPlan netPlan)
Returns the set of fibers occupied in each wavelength.
|
static List<Set<Long>> |
getWavelengthFiberOccupancy(NetPlan netPlan,
long layerId)
Returns the set of fibers occupied in each wavelength.
|
static int[] |
parseSeqRegenerators(Map<String,String> attributeMap)
Returns the sequence of regenerators/wavelength converters from an attribute
map, where the associated key corresponds to
SEQUENCE_OF_REGENERATORS_ATTRIBUTE_NAME . |
static int[] |
parseSeqWavelengths(Map<String,String> attributeMap)
Returns the sequence of wavelengths from an attribute map, where the associated
key corresponds to
SEQUENCE_OF_WAVELENGTHS_ATTRIBUTE_NAME . |
static void |
releaseResources(List<Long> seqFibers,
int[] seqWavelengths,
List<Set<Long>> wavelengthFiberOccupancy)
Updates
wavelengthFiberOccupancy to consider that a lightpath is releasing
used wavelengths. |
static void |
releaseResources(List<Long> seqFibers,
int wavelengthId,
List<Set<Long>> wavelengthFiberOccupancy)
Updates
wavelengthFiberOccupancy to consider that a lightpath is releasing
used wavelengths. |
static void |
releaseResources(Map<Long,Pair<Long,Long>> fiberMap,
List<Long> seqFibers,
int[] seqWavelengths,
List<Set<Long>> wavelengthFiberOccupancy,
int[] seqRegenerators,
Map<Long,Integer> nodeRegeneratorOccupancy)
Updates
wavelengthFiberOccupancy to consider that a lightpath is releasing
used wavelengths. |
static void |
releaseResources(Map<Long,Pair<Long,Long>> fiberMap,
List<Long> seqFibers,
int wavelengthId,
List<Set<Long>> wavelengthFiberOccupancy,
int[] seqRegenerators,
Map<Long,Integer> nodeRegeneratorOccupancy)
Updates
wavelengthFiberOccupancy to consider that a lightpath is releasing
used wavelengths. |
static void |
setFiberNumWavelengths(NetPlan netPlan,
long fiberId,
int numWavelengths)
Sets the number of wavelengths available on the given fiber.
|
static void |
setFiberNumWavelengths(NetPlan netPlan,
long layerId,
long fiberId,
int numWavelengths)
Sets the number of wavelengths available on the given fiber.
|
static void |
setFibersNumWavelengths(NetPlan netPlan,
int numWavelengths)
Sets the number of wavelengths available in each fiber to the same value.
|
static void |
setFibersNumWavelengths(NetPlan netPlan,
int[] w_f)
Sets the number of wavelengths available in each fiber.
|
static void |
setFibersNumWavelengths(NetPlan netPlan,
long layerId,
int numWavelengths)
Sets the number of wavelengths available in each fiber to the same value.
|
static void |
setFibersNumWavelengths(NetPlan netPlan,
long layerId,
int[] w_f)
Sets the number of wavelengths available in each fiber.
|
static void |
setFibersNumWavelengths(NetPlan netPlan,
long layerId,
Map<Long,Integer> w_f)
Sets the number of wavelengths available in each fiber.
|
static void |
setFibersNumWavelengths(NetPlan netPlan,
Map<Long,Integer> w_f)
Sets the number of wavelengths available in each fiber.
|
static void |
setLightpathSeqRegenerators(NetPlan netPlan,
long lpId,
int[] seqRegenerators)
Sets the sequence of regenerators/wavelength converters for a given lightpath.
|
static void |
setLightpathSeqRegenerators(NetPlan netPlan,
long layerId,
long lpId,
int[] seqRegenerators)
Sets the sequence of regenerators/wavelength converters for a given lightpath.
|
static void |
setLightpathSeqWavelengths(NetPlan netPlan,
long lpId,
int wavelengthId)
Sets the current wavelength for the given lightpath, assuming no wavelength conversion.
|
static void |
setLightpathSeqWavelengths(NetPlan netPlan,
long lpId,
int[] seqWavelengths)
Sets the sequence of wavelengths for the given lightpath.
|
static void |
setLightpathSeqWavelengths(NetPlan netPlan,
long layerId,
long lpId,
int wavelengthId)
Sets the current wavelength for the given lightpath, assuming no wavelength conversion.
|
static void |
setLightpathSeqWavelengths(NetPlan netPlan,
long layerId,
long lpId,
int[] seqWavelengths)
Sets the sequence of wavelengths for the given lightpath.
|
static void |
setProtectionLightpathSeqRegenerators(NetPlan netPlan,
long protectionLightpathId,
int[] seqRegenerators)
Sets the sequence of regenerators/wavelength converters for a given protection lightpath.
|
static void |
setProtectionLightpathSeqRegenerators(NetPlan netPlan,
long layerId,
long protectionLightpathId,
int[] seqRegenerators)
Sets the sequence of regenerators/wavelength converters for a given protection lightpath.
|
static void |
setProtectionLightpathSeqWavelengths(NetPlan netPlan,
long protectionLightpathId,
int wavelengthId)
Sets the sequence of wavelengths for a protection lightpath, assuming no wavelength conversion.
|
static void |
setProtectionLightpathSeqWavelengths(NetPlan netPlan,
long protectionLightpathId,
int[] seqWavelengths)
Sets the sequence of wavelengths for a protection lightpath.
|
static void |
setProtectionLightpathSeqWavelengths(NetPlan netPlan,
long layerId,
long protectionLightpathId,
int wavelengthId)
Sets the sequence of wavelengths for a protection lightpath, assuming no wavelength conversion.
|
static void |
setProtectionLightpathSeqWavelengths(NetPlan netPlan,
long layerId,
long protectionLightpathId,
int[] seqWavelengths)
Sets the sequence of wavelengths for a protection lightpath.
|
static int[] |
WA_firstFit(Map<Long,Pair<Long,Long>> fiberMap,
List<Long> seqFibers,
Map<Long,Integer> w_f,
List<Set<Long>> wavelengthFiberOccupancy)
Wavelength assignment algorithm based on a first-fit fashion.
|
static Pair<int[],int[]> |
WA_RPP_firstFit(Map<Long,Pair<Long,Long>> fiberMap,
List<Long> seqFibers,
Map<Long,Integer> w_f,
List<Set<Long>> wavelengthFiberOccupancy,
Map<Long,Double> l_f,
Map<Long,Integer> nodeRegeneratorOccupancy,
double maxRegeneratorDistanceInKm)
Wavelength assignment algorithm based on a first-fit fashion assuming
full wavelength conversion and regeneration.
|
public static final String SEQUENCE_OF_REGENERATORS_ATTRIBUTE_NAME
public static final String SEQUENCE_OF_WAVELENGTHS_ATTRIBUTE_NAME
public static void allocateResources(List<Long> seqFibers, int[] seqWavelengths, List<Set<Long>> wavelengthFiberOccupancy)
wavelengthFiberOccupancy
to consider that a new lightpath is occupying
a wavelength in each fiber.seqFibers
- Sequence of traversed fibersseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)wavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthpublic static void allocateResources(List<Long> seqFibers, int wavelengthId, List<Set<Long>> wavelengthFiberOccupancy)
wavelengthFiberOccupancy
to consider that a new lightpath is occupying
a wavelength in each fiber.seqFibers
- Sequence of traversed fiberswavelengthId
- Wavelength identifier (the same for all traversed fibers)wavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthpublic static void allocateResources(Map<Long,Pair<Long,Long>> fiberMap, List<Long> seqFibers, int[] seqWavelengths, List<Set<Long>> wavelengthFiberOccupancy, int[] seqRegenerators, Map<Long,Integer> nodeRegeneratorOccupancy)
wavelengthFiberOccupancy
to consider that a new lightpath is occupying
a wavelength in each fiber.fiberMap
- Map of fibers, where the key is the unique fiber identifier and the value is a Pair
representing the origin node and the destination node of the fiber, respectively. It is mandatory that can be iterated in ascending order of fiber identifier (i.e. using TreeMap
or those Map
objects returned from Net2Plan
objectseqFibers
- Sequence of traversed fibersseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)wavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthseqRegenerators
- A 0-1 array indicating whether (1) or not (0) a regenerator/wavelength converter is required at the origin node of the corresponding fibernodeRegeneratorOccupancy
- Number of regenerators installed per nodepublic static void allocateResources(Map<Long,Pair<Long,Long>> fiberMap, List<Long> seqFibers, int wavelengthId, List<Set<Long>> wavelengthFiberOccupancy, int[] seqRegenerators, Map<Long,Integer> nodeRegeneratorOccupancy)
wavelengthFiberOccupancy
to consider that a new lightpath is occupying
a wavelength in each fiber.fiberMap
- Map of fibers, where the key is the unique fiber identifier and the value is a Pair
representing the origin node and the destination node of the fiber, respectively. It is mandatory that can be iterated in ascending order of fiber identifier (i.e. using TreeMap
or those Map
objects returned from Net2Plan
objectseqFibers
- Sequence of traversed fiberswavelengthId
- Wavelength identifier (the same for all traversed fibers)wavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthseqRegenerators
- A 0-1 array indicating whether (1) or not (0) a regenerator/wavelength converter is required at the origin node of the corresponding fibernodeRegeneratorOccupancy
- Number of regenerators installed per nodepublic static void checkConsistency(NetPlan netPlan)
Performs extra checks to those applicable to every network design, especially focused on WDM networks.
netPlan
- A NetPlan
representing a WDM physical topologypublic static void checkConsistency(NetPlan netPlan, long layerId)
Performs extra checks to those applicable to every network design, especially focused on WDM networks.
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierpublic static int[] computeRegeneratorPositions(Map<Long,Pair<Long,Long>> fiberMap, List<Long> seqFibers, int[] seqWavelengths, Map<Long,Double> l_f, double maxRegeneratorDistanceInKm)
fiberMap
- Map of fibers, where the key is the unique fiber identifier and the value is a Pair
representing the origin node and the destination node of the fiber, respectively. It is mandatory that can be iterated in ascending order of fiber identifier (i.e. using TreeMap
or those Map
objects returned from Net2Plan
objectseqFibers
- Sequence of traversed fibersseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)l_f
- Physical length in km per fibermaxRegeneratorDistanceInKm
- Maximum regeneration distancepublic static int[] computeRegeneratorPositions(Map<Long,Pair<Long,Long>> fiberMap, List<Long> seqFibers, Map<Long,Double> l_f, double maxRegeneratorDistanceInKm)
fiberMap
- Map of fibers, where the key is the unique fiber identifier and the value is a Pair
representing the origin node and the destination node of the fiber, respectively. It is mandatory that can be iterated in ascending order of fiber identifier (i.e. using TreeMap
or those Map
objects returned from Net2Plan
objectseqFibers
- Sequence of traversed fibersl_f
- Physical length in km per fibermaxRegeneratorDistanceInKm
- Maximum regeneration distancepublic static int getFiberNumWavelengths(NetPlan netPlan, long fiberId)
getLinkCapacity()
from the NetPlan
object,
but converting capacity value from double
to int
.netPlan
- A NetPlan
representing a WDM physical topologyfiberId
- Fiber identifierpublic static int getFiberNumWavelengths(NetPlan netPlan, long layerId, long fiberId)
getLinkCapacity()
from the NetPlan
object,
but converting capacity value from double
to int
.netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierfiberId
- Fiber identifierpublic static Map<Long,Integer> getFiberNumWavelengthsMap(NetPlan netPlan)
getLinkCapacityMap()
from the NetPlan
object,
but converting capacity values from Double
to Integer
.netPlan
- A NetPlan
representing a WDM physical topologypublic static Map<Long,Integer> getFiberNumWavelengthsMap(NetPlan netPlan, long layerId)
getLinkCapacityMap(layerId)
from the NetPlan
object,
but converting capacity values from Double
to Integer
.netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierpublic static int[] getFiberNumWavelengthsVector(NetPlan netPlan)
netPlan
- A NetPlan
representing a WDM physical topologypublic static int[] getFiberNumWavelengthsVector(NetPlan netPlan, long layerId)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierpublic static Map<Long,Set<Integer>> getFiberWavelengthOccupancyMap(NetPlan netPlan)
netPlan
- A NetPlan
representing a physical topologypublic static Map<Long,Set<Integer>> getFiberWavelengthOccupancyMap(NetPlan netPlan, long layerId)
netPlan
- A NetPlan
representing a physical topologylayerId
- Layer identifierpublic static int[] getLightpathSeqRegenerators(NetPlan netPlan, long lightpathId)
netPlan
- A NetPlan
representing a WDM physical topologylightpathId
- Lightpath identifierpublic static int[] getLightpathSeqRegenerators(NetPlan netPlan, long layerId, long lightpathId)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierlightpathId
- Lightpath identifierpublic static int[] getLightpathSeqWavelengths(NetPlan netPlan, long lightpathId)
netPlan
- A NetPlan
representing a WDM physical topologylightpathId
- Lightpath identifierpublic static int[] getLightpathSeqWavelengths(NetPlan netPlan, long layerId, long lightpathId)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierlightpathId
- Lightpath identifierpublic static Map<Long,Integer> getNodeRegeneratorOccupancyMap(NetPlan netPlan)
netPlan
- A NetPlan
representing a physical topologypublic static Map<Long,Integer> getNodeRegeneratorOccupancyMap(NetPlan netPlan, long layerId)
netPlan
- A NetPlan
representing a physical topologylayerId
- Layer identifierpublic static int[] getProtectionLightpathSeqRegenerators(NetPlan netPlan, long protectionLightpathId)
netPlan
- A NetPlan
representing a WDM physical topologyprotectionLightpathId
- Protection lightpath identifierpublic static int[] getProtectionLightpathSeqRegenerators(NetPlan netPlan, long layerId, long protectionLightpathId)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierprotectionLightpathId
- Protection lightpath identifierpublic static int[] getProtectionLightpathSeqWavelengths(NetPlan netPlan, long protectionLightpathId)
netPlan
- A NetPlan
representing a WDM physical topologyprotectionLightpathId
- Protection lightpath identifierpublic static int[] getProtectionLightpathSeqWavelengths(NetPlan netPlan, long layerId, long protectionLightpathId)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierprotectionLightpathId
- Protection lightpath identifierpublic static List<Set<Long>> getWavelengthFiberOccupancy(NetPlan netPlan)
Returns the set of fibers occupied in each wavelength.
netPlan
- A NetPlan
representing a physical topologypublic static List<Set<Long>> getWavelengthFiberOccupancy(NetPlan netPlan, long layerId)
Returns the set of fibers occupied in each wavelength.
netPlan
- A NetPlan
representing a physical topologylayerId
- Layer identifierpublic static int[] parseSeqRegenerators(Map<String,String> attributeMap)
SEQUENCE_OF_REGENERATORS_ATTRIBUTE_NAME
.attributeMap
- Attribute map, where key is the attribute name and the value is the parameter valuepublic static int[] parseSeqWavelengths(Map<String,String> attributeMap)
SEQUENCE_OF_WAVELENGTHS_ATTRIBUTE_NAME
.attributeMap
- Attribute map, where key is the attribute name and the value is the parameter valuepublic static void releaseResources(List<Long> seqFibers, int[] seqWavelengths, List<Set<Long>> wavelengthFiberOccupancy)
wavelengthFiberOccupancy
to consider that a lightpath is releasing
used wavelengths.seqFibers
- Sequence of traversed fibersseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)wavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthpublic static void releaseResources(List<Long> seqFibers, int wavelengthId, List<Set<Long>> wavelengthFiberOccupancy)
wavelengthFiberOccupancy
to consider that a lightpath is releasing
used wavelengths.seqFibers
- Sequence of traversed fiberswavelengthId
- Wavelength identifier (the same for all traversed fibers)wavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthpublic static void releaseResources(Map<Long,Pair<Long,Long>> fiberMap, List<Long> seqFibers, int[] seqWavelengths, List<Set<Long>> wavelengthFiberOccupancy, int[] seqRegenerators, Map<Long,Integer> nodeRegeneratorOccupancy)
wavelengthFiberOccupancy
to consider that a lightpath is releasing
used wavelengths.fiberMap
- Map of fibers, where the key is the unique fiber identifier and the value is a Pair
representing the origin node and the destination node of the fiber, respectively. It is mandatory that can be iterated in ascending order of fiber identifier (i.e. using TreeMap
or those Map
objects returned from Net2Plan
objectseqFibers
- Sequence of traversed fibersseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)wavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthseqRegenerators
- A 0-1 array indicating whether (1) or not (0) a regenerator/wavelength converter is required at the origin node of the corresponding fibernodeRegeneratorOccupancy
- Number of regenerators installed per nodepublic static void releaseResources(Map<Long,Pair<Long,Long>> fiberMap, List<Long> seqFibers, int wavelengthId, List<Set<Long>> wavelengthFiberOccupancy, int[] seqRegenerators, Map<Long,Integer> nodeRegeneratorOccupancy)
wavelengthFiberOccupancy
to consider that a lightpath is releasing
used wavelengths.fiberMap
- Map of fibers, where the key is the unique fiber identifier and the value is a Pair
representing the origin node and the destination node of the fiber, respectively. It is mandatory that can be iterated in ascending order of fiber identifier (i.e. using TreeMap
or those Map
objects returned from Net2Plan
objectseqFibers
- Sequence of traversed fiberswavelengthId
- Wavelength identifier (the same for all traversed fibers)wavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthseqRegenerators
- A 0-1 array indicating whether (1) or not (0) a regenerator/wavelength converter is required at the origin node of the corresponding fibernodeRegeneratorOccupancy
- Number of regenerators installed per nodepublic static void setFiberNumWavelengths(NetPlan netPlan, long fiberId, int numWavelengths)
netPlan
- A NetPlan
representing a WDM physical topologyfiberId
- Fiber identifiernumWavelengths
- Number of wavelengths for the given fiberpublic static void setFiberNumWavelengths(NetPlan netPlan, long layerId, long fiberId, int numWavelengths)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierfiberId
- Fiber identifiernumWavelengths
- Number of wavelengths for the given fiberpublic static void setFibersNumWavelengths(NetPlan netPlan, int numWavelengths)
netPlan
- A NetPlan
representing a WDM physical topologynumWavelengths
- Number of wavelengths for all fiberspublic static void setFibersNumWavelengths(NetPlan netPlan, int[] w_f)
netPlan
- A NetPlan
representing a WDM physical topologyw_f
- Number of wavelengths per fiberpublic static void setFibersNumWavelengths(NetPlan netPlan, long layerId, int numWavelengths)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifiernumWavelengths
- Number of wavelengths for all fiberspublic static void setFibersNumWavelengths(NetPlan netPlan, long layerId, int[] w_f)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierw_f
- Number of wavelengths per fiberpublic static void setFibersNumWavelengths(NetPlan netPlan, long layerId, Map<Long,Integer> w_f)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierw_f
- Number of wavelengths per fiberpublic static void setFibersNumWavelengths(NetPlan netPlan, Map<Long,Integer> w_f)
netPlan
- A NetPlan
representing a WDM physical topologyw_f
- Number of wavelengths per fiberpublic static void setLightpathSeqRegenerators(NetPlan netPlan, long lpId, int[] seqRegenerators)
netPlan
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierseqRegenerators
- A 0-1 array indicating whether (1) or not (0) a regenerator/wavelength converter is required at the origin node of the corresponding fiberpublic static void setLightpathSeqRegenerators(NetPlan netPlan, long layerId, long lpId, int[] seqRegenerators)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierlpId
- Lightpath identifierseqRegenerators
- A 0-1 array indicating whether (1) or not (0) a regenerator/wavelength converter is required at the origin node of the corresponding fiberpublic static void setLightpathSeqWavelengths(NetPlan netPlan, long lpId, int wavelengthId)
netPlan
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierwavelengthId
- Wavelength identifier (the same for all traversed fibers)public static void setLightpathSeqWavelengths(NetPlan netPlan, long lpId, int[] seqWavelengths)
netPlan
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)public static void setLightpathSeqWavelengths(NetPlan netPlan, long layerId, long lpId, int wavelengthId)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierlpId
- Lightpath identifierwavelengthId
- Wavelength identifier (the same for all traversed fibers)public static void setLightpathSeqWavelengths(NetPlan netPlan, long layerId, long lpId, int[] seqWavelengths)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierlpId
- Lightpath identifierseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)public static void setProtectionLightpathSeqRegenerators(NetPlan netPlan, long protectionLightpathId, int[] seqRegenerators)
netPlan
- A NetPlan
representing a WDM physical topologyprotectionLightpathId
- Protection lightpath identifierseqRegenerators
- A 0-1 array indicating whether (1) or not (0) a regenerator/wavelength converter is required at the origin node of the corresponding fiberpublic static void setProtectionLightpathSeqRegenerators(NetPlan netPlan, long layerId, long protectionLightpathId, int[] seqRegenerators)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierprotectionLightpathId
- Protection lightpath identifierseqRegenerators
- A 0-1 array indicating whether (1) or not (0) a regenerator/wavelength converter is required at the origin node of the corresponding fiberpublic static void setProtectionLightpathSeqWavelengths(NetPlan netPlan, long protectionLightpathId, int wavelengthId)
netPlan
- A NetPlan
representing a WDM physical topologyprotectionLightpathId
- Protection lightpath identifierwavelengthId
- Wavelength identifier (the same for all traversed fibers)public static void setProtectionLightpathSeqWavelengths(NetPlan netPlan, long protectionLightpathId, int[] seqWavelengths)
netPlan
- A NetPlan
representing a WDM physical topologyprotectionLightpathId
- Protection lightpath identifierseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)public static void setProtectionLightpathSeqWavelengths(NetPlan netPlan, long layerId, long protectionLightpathId, int wavelengthId)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierprotectionLightpathId
- Protection lightpath identifierwavelengthId
- Wavelength identifier (the same for all traversed fibers)public static void setProtectionLightpathSeqWavelengths(NetPlan netPlan, long layerId, long protectionLightpathId, int[] seqWavelengths)
netPlan
- A NetPlan
representing a WDM physical topologylayerId
- Layer identifierprotectionLightpathId
- Protection lightpath identifierseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)public static int[] WA_firstFit(Map<Long,Pair<Long,Long>> fiberMap, List<Long> seqFibers, Map<Long,Integer> w_f, List<Set<Long>> wavelengthFiberOccupancy)
Wavelength assignment algorithm based on a first-fit fashion. Wavelengths are indexed from 0 to Wf-1, where Wf is the number of wavelengths supported by fiber f. Then, the wavelength assigned to each lightpath (along the whole physical route) is the minimum index among the common free-wavelength set for all traversed fibers.
In case a lightpath cannot be allocated, the corresponding sequence of
wavelengths (seqWavelengths
parameter) will be an empty array.
Important: wavelengthFiberOccupancy
is not updated, so
subsequent usage of allocateResources
method is encouraged.
fiberMap
- Map of fibers, where the key is the unique fiber identifier and the value is a Pair
representing the origin node and the destination node of the fiber, respectively. It is mandatory that can be iterated in ascending order of fiber identifier (i.e. using TreeMap
or those Map
objects returned from Net2Plan
objectseqFibers
- Sequence of traversed fibersw_f
- Number of wavelengths per fiberwavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthpublic static Pair<int[],int[]> WA_RPP_firstFit(Map<Long,Pair<Long,Long>> fiberMap, List<Long> seqFibers, Map<Long,Integer> w_f, List<Set<Long>> wavelengthFiberOccupancy, Map<Long,Double> l_f, Map<Long,Integer> nodeRegeneratorOccupancy, double maxRegeneratorDistanceInKm)
Wavelength assignment algorithm based on a first-fit fashion assuming full wavelength conversion and regeneration. Each node selects the first free wavelength for its output fiber, and next nodes in the lightpath try to maintain it. If not possible, or regeneration is needed, then include a regenerator (can act also as a full wavelength converter) and search for the first free wavelength, and so on.
In case a lightpath cannot be allocated, the corresponding sequence of
wavelengths (seqWavelengths
parameter) will be an empty array.
fiberMap
- Map of fibers, where the key is the unique fiber identifier and the value is a Pair
representing the origin node and the destination node of the fiber, respectively. It is mandatory that can be iterated in ascending order of fiber identifier (i.e. using TreeMap
or those Map
objects returned from Net2Plan
objectseqFibers
- Sequence of traversed fibersw_f
- Number of wavelengths per fiberwavelengthFiberOccupancy
- Set of occupied fibers in each wavelengthl_f
- Physical length in km per fibernodeRegeneratorOccupancy
- Number of regenerators installed per nodemaxRegeneratorDistanceInKm
- Maximum regeneration distance