public class WDMUtils
extends Object
Modifier and Type | Class and Description |
---|---|
static class |
WDMUtils.LightpathAdd
This class represents the request to add a new lightpath.
|
static class |
WDMUtils.LightpathModify
This class represents the request to modify an existing lightpath.
|
static class |
WDMUtils.LightpathRemove
This class represents the request to remove an existing lightpath.
|
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.
|
static String |
SEQUENCE_OF_WAVELENGTHS_INITIAL_ROUTE_ATTRIBUTE_NAME
Route/protection segment attribute name for sequence of wavelengths for the initial sequence of links (when the route was created)
|
Modifier and Type | Method and Description |
---|---|
static Route |
addLightpathAndUpdateOccupancy(Demand demand,
List<Link> seqFibers,
double binaryRatePerChannel,
int[] seqWavelengths,
DoubleMatrix2D wavelengthFiberOccupancy)
Creates a new lightpath and updates the wavelength occupancy.
|
static Route |
addLightpathAndUpdateOccupancy(Demand demand,
List<Link> seqFibers,
double binaryRatePerChannel,
int[] seqWavelengths,
int[] seqRegenerators,
DoubleMatrix2D wavelengthFiberOccupancy,
DoubleMatrix1D nodeRegeneratorOccupancy)
Creates a new lightpath and updates the wavelength occupancy.
|
static Route |
addLightpathAndUpdateOccupancy(Demand demand,
List<Link> seqFibers,
double binaryRatePerChannel,
int wavelengthId,
DoubleMatrix2D wavelengthFiberOccupancy)
Creates a new lightpath and updates the wavelength occupancy.
|
static ProtectionSegment |
addLightpathAsProtectionSegmentAndUpdateOccupancy(List<Link> seqFibers,
int[] seqWavelengths,
DoubleMatrix2D wavelengthFiberOccupancy)
Creates a new protection lightpath and updates the wavelength occupancy.
|
static ProtectionSegment |
addLightpathAsProtectionSegmentAndUpdateOccupancy(List<Link> seqFibers,
int[] seqWavelengths,
int[] seqRegenerators,
DoubleMatrix2D wavelengthFiberOccupancy,
DoubleMatrix1D nodeRegeneratorOccupancy)
Creates a new protection lightpath and updates the wavelength occupancy.
|
static ProtectionSegment |
addLightpathAsProtectionSegmentAndUpdateOccupancy(List<Link> seqFibers,
int wavelengthId,
DoubleMatrix2D wavelengthFiberOccupancy)
Creates a new protection lightpath and updates the wavelength occupancy.
|
static void |
allocateResources(List<Link> seqFibers,
int[] seqWavelengths,
DoubleMatrix2D wavelengthFiberOccupancy,
int[] seqRegenerators,
DoubleMatrix1D nodeRegeneratorOccupancy)
Updates
wavelengthFiberOccupancy to consider that a new lightpath is occupying
a wavelength in each fiber. |
static void |
checkConsistency(NetPlan netPlan,
boolean countDownLightpathResources,
NetworkLayer... optionalLayerParameter)
Performs extra checks to those applicable to every network design, especially
focused on WDM networks.
|
static int[] |
computeRegeneratorPositions(List<Link> seqFibers,
DoubleMatrix1D 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[] |
computeRegeneratorPositions(List<Link> seqFibers,
int[] seqWavelengths,
DoubleMatrix1D 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 |
getFiberNumWavelengths(Link fiber)
Returns the number of wavelengths for the given fiber.
|
static int[] |
getLightpathSeqRegenerators(ProtectionSegment segment)
Returns the sequence of regenerators/wavelength converters for the given lightpath.
|
static int[] |
getLightpathSeqRegenerators(Route route)
Returns the sequence of regenerators/wavelength converters for the given lightpath.
|
static int[] |
getLightpathSeqWavelengths(ProtectionSegment segment)
Returns the sequence of wavelengths for the given lightpath.
|
static int[] |
getLightpathSeqWavelengths(Route route)
Returns the sequence of wavelengths for the given lightpath.
|
static int[] |
getLightpathSeqWavelengthsInitialRoute(Route route)
Returns the initial sequence of wavelengths for the given lightpath (when it was created).
|
static DoubleMatrix2D |
getMatrixWavelength2FiberOccupancy(NetPlan netPlan,
boolean countDownLightpathResources,
NetworkLayer... optionalLayerParameter)
Returns the fiber occupied (columns) in each wavelength (rows).
|
static int[] |
getProtectionLightpathSeqRegenerators(ProtectionSegment segment)
Returns the sequence of regenerators/wavelength converters for the given lightpath.
|
static int[] |
getProtectionLightpathSeqWavelengths(ProtectionSegment segment)
Returns the sequence of wavelengths for a given protection lightpath.
|
static DoubleMatrix1D |
getVectorFiberNumWavelengths(NetPlan netPlan,
NetworkLayer... optionalLayerParameter)
Returns the total number of wavelengths in each fiber.
|
static DoubleMatrix1D |
getVectorNodeRegeneratorOccupancy(NetPlan netPlan,
boolean countDownLightpathResources,
NetworkLayer... optionalLayerParameter)
Returns the number of regenerators installed per node.
|
static boolean |
isNonConflictingRWA(List<Link> links,
int[] seqWavelengths,
DoubleMatrix2D wavelengthFiberOccupancy)
Returns
true if the given sequence of wavelengths has not been allocated in the given sequence of links, false otherwise. |
static boolean |
isNonConflictingRWAPair(List<Link> linksPrimary,
int[] seqWavelengthsPrimary,
List<Link> linksBackup,
int[] seqWavelengthsBackup,
DoubleMatrix2D wavelengthFiberOccupancy)
Returns
true if the given pair of sequences of wavelengths has not been allocated in the given pair of sequences of links, false otherwise. |
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 int[] |
parseSeqWavelengthsInitialRoute(Map<String,String> attributeMap)
Returns the initial sequence of wavelengths from an attribute map, where the associated
key corresponds to
SEQUENCE_OF_WAVELENGTHS_ATTRIBUTE_NAME . |
static void |
releaseResources(List<Link> seqFibers,
int[] seqWavelengths,
DoubleMatrix2D wavelengthFiberOccupancy,
int[] seqRegenerators,
DoubleMatrix1D nodeRegeneratorOccupancy)
Updates
wavelengthFiberOccupancy to consider that a lightpath is releasing
used wavelengths. |
static void |
removeLightpathAndUpdateOccupancy(ProtectionSegment lp,
DoubleMatrix2D wavelengthFiberOccupancy)
Removes a protection lightpath and updates the occupancy.
|
static void |
removeLightpathAndUpdateOccupancy(ProtectionSegment lp,
DoubleMatrix2D wavelengthFiberOccupancy,
DoubleMatrix1D nodeRegeneratorOccupancy)
Removes a protection lightpath and updates the occupancy.
|
static void |
removeLightpathAndUpdateOccupancy(Route lp,
DoubleMatrix2D wavelengthFiberOccupancy,
boolean releaseResourcesOfOriginalRoute)
Removes a lightpath and updates the occupancy.
|
static void |
removeLightpathAndUpdateOccupancy(Route lp,
DoubleMatrix2D wavelengthFiberOccupancy,
DoubleMatrix1D nodeRegeneratorOccupancy,
boolean releaseResourcesOfOriginalRoute)
Removes a lightpath and updates the occupancy.
|
static void |
setFiberNumWavelengths(Link fiber,
int numWavelengths)
Sets the number of wavelengths available on the given fiber.
|
static void |
setFibersNumWavelengths(NetPlan netPlan,
int[] w_f,
NetworkLayer... optionalLayerParameter)
Sets the number of wavelengths available in each fiber.
|
static void |
setFibersNumWavelengths(NetPlan netPlan,
int numWavelengths,
NetworkLayer... optionalLayerParameter)
Sets the number of wavelengths available in each fiber to the same value.
|
static void |
setLightpathSeqRegenerators(ProtectionSegment lp,
int[] seqRegenerators)
Sets the sequence of regenerators/wavelength converters for a given lightpath.
|
static void |
setLightpathSeqRegenerators(Route lp,
int[] seqRegenerators)
Sets the sequence of regenerators/wavelength converters for a given lightpath.
|
static void |
setLightpathSeqWavelengths(ProtectionSegment lp,
int[] seqWavelengths)
Sets the current wavelength for the given lightpath, assuming no wavelength conversion.
|
static void |
setLightpathSeqWavelengths(Route lp,
int wavelengthId)
Sets the current wavelength for the given lightpath, assuming no wavelength conversion.
|
static void |
setLightpathSeqWavelengths(Route lp,
int[] seqWavelengths)
Sets the sequence of wavelengths for the given lightpath.
|
static void |
setLightpathSeqWavelengthsInitialRoute(Route lp,
int[] seqWavelengths)
Sets the initial sequence of wavelengths for the given lightpath.
|
static void |
setProtectionLightpathSeqRegenerators(ProtectionSegment segment,
int[] seqRegenerators)
Sets the sequence of regenerators/wavelength converters for a given protection lightpath.
|
static void |
setProtectionLightpathSeqWavelengths(ProtectionSegment segment,
int wavelengthId)
Sets the given wavelength for all fibers traversing a protection lightpath.
|
static void |
setProtectionLightpathSeqWavelengths(ProtectionSegment segment,
int[] seqWavelengths)
Sets the sequence of wavelengths for a protection lightpath.
|
static int[] |
WA_firstFit(List<Link> seqFibers,
DoubleMatrix2D wavelengthFiberOccupancy)
Wavelength assignment algorithm based on a first-fit fashion.
|
static Pair<int[],int[]> |
WA_firstFitTwoRoutes(List<Link> seqFibers_1,
List<Link> seqFibers_2,
DoubleMatrix2D wavelengthFiberOccupancy)
Wavelength assignment algorithm based on a first-fit fashion.
|
static Pair<int[],int[]> |
WA_RPP_firstFit(List<Link> seqFibers,
DoubleMatrix2D wavelengthFiberOccupancy,
DoubleMatrix1D l_f,
DoubleMatrix1D 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 final String SEQUENCE_OF_WAVELENGTHS_INITIAL_ROUTE_ATTRIBUTE_NAME
public static Route addLightpathAndUpdateOccupancy(Demand demand, List<Link> seqFibers, double binaryRatePerChannel, int[] seqWavelengths, DoubleMatrix2D wavelengthFiberOccupancy)
demand
- DemandseqFibers
- Sequence of fibersbinaryRatePerChannel
- Binary rate per channel in GbpsseqWavelengths
- Sequence of wavelengthswavelengthFiberOccupancy
- Occupied fibers in each wavelengthpublic static Route addLightpathAndUpdateOccupancy(Demand demand, List<Link> seqFibers, double binaryRatePerChannel, int[] seqWavelengths, int[] seqRegenerators, DoubleMatrix2D wavelengthFiberOccupancy, DoubleMatrix1D nodeRegeneratorOccupancy)
demand
- DemandseqFibers
- Sequence of fibersbinaryRatePerChannel
- Binary rate per channel in GbpsseqWavelengths
- Sequence of wavelengthsseqRegenerators
- Sequence of regeneratorswavelengthFiberOccupancy
- Occupied fibers in each wavelengthnodeRegeneratorOccupancy
- Number of regenerators installed per nodepublic static Route addLightpathAndUpdateOccupancy(Demand demand, List<Link> seqFibers, double binaryRatePerChannel, int wavelengthId, DoubleMatrix2D wavelengthFiberOccupancy)
demand
- DemandseqFibers
- Sequence of fibersbinaryRatePerChannel
- Binary rate per channel in GbpswavelengthId
- Wavelength identifier (the same for all traversed fibers)wavelengthFiberOccupancy
- Occupied fibers in each wavelengthpublic static ProtectionSegment addLightpathAsProtectionSegmentAndUpdateOccupancy(List<Link> seqFibers, int[] seqWavelengths, DoubleMatrix2D wavelengthFiberOccupancy)
seqFibers
- Sequence of fibersseqWavelengths
- Sequence of wavelengthswavelengthFiberOccupancy
- Occupied fibers in each wavelengthpublic static ProtectionSegment addLightpathAsProtectionSegmentAndUpdateOccupancy(List<Link> seqFibers, int[] seqWavelengths, int[] seqRegenerators, DoubleMatrix2D wavelengthFiberOccupancy, DoubleMatrix1D nodeRegeneratorOccupancy)
seqFibers
- Sequence of fibersseqWavelengths
- Sequence of wavelengthsseqRegenerators
- Sequence of regeneratoswavelengthFiberOccupancy
- Occupied fibers in each wavelengthnodeRegeneratorOccupancy
- Number of regenerators installed per nodepublic static ProtectionSegment addLightpathAsProtectionSegmentAndUpdateOccupancy(List<Link> seqFibers, int wavelengthId, DoubleMatrix2D wavelengthFiberOccupancy)
seqFibers
- Sequence of fiberswavelengthId
- Wavelength identifier (the same for all traversed fibers)wavelengthFiberOccupancy
- Occupied fibers in each wavelengthpublic static void allocateResources(List<Link> seqFibers, int[] seqWavelengths, DoubleMatrix2D wavelengthFiberOccupancy, int[] seqRegenerators, DoubleMatrix1D nodeRegeneratorOccupancy)
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 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, boolean countDownLightpathResources, NetworkLayer... optionalLayerParameter)
Performs extra checks to those applicable to every network design, especially focused on WDM networks.
netPlan
- A NetPlan
representing a WDM physical topologycountDownLightpathResources
- Wheter or not include lightpaths that are downoptionalLayerParameter
- Network layer (optional)public static int[] computeRegeneratorPositions(List<Link> seqFibers, DoubleMatrix1D l_f, double maxRegeneratorDistanceInKm)
seqFibers
- Sequence of traversed fibersmaxRegeneratorDistanceInKm
- Maximum regeneration distancel_f
- Physical length in km per fiberpublic static int[] computeRegeneratorPositions(List<Link> seqFibers, int[] seqWavelengths, DoubleMatrix1D l_f, double maxRegeneratorDistanceInKm)
seqFibers
- 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 getFiberNumWavelengths(Link fiber)
getCapacity()
from the Link
object,
but converting capacity value from double
to int
.fiber
- Link fiberpublic static int[] getLightpathSeqRegenerators(ProtectionSegment segment)
segment
- Lightpath (as a protection segment)public static int[] getLightpathSeqRegenerators(Route route)
route
- Ligthpath (as a route)public static int[] getLightpathSeqWavelengths(ProtectionSegment segment)
segment
- Lightpath (as a protection sement)public static int[] getLightpathSeqWavelengths(Route route)
route
- Lightpath (as a route)public static int[] getLightpathSeqWavelengthsInitialRoute(Route route)
route
- Lightpath (as a route)public static DoubleMatrix2D getMatrixWavelength2FiberOccupancy(NetPlan netPlan, boolean countDownLightpathResources, NetworkLayer... optionalLayerParameter)
netPlan
- Current designcountDownLightpathResources
- Include lightpaths that are downoptionalLayerParameter
- Network layer (optional)public static int[] getProtectionLightpathSeqRegenerators(ProtectionSegment segment)
segment
- Lightpath (as a protection segment)public static int[] getProtectionLightpathSeqWavelengths(ProtectionSegment segment)
segment
- Lightpath (as a protection segment)public static DoubleMatrix1D getVectorFiberNumWavelengths(NetPlan netPlan, NetworkLayer... optionalLayerParameter)
netPlan
- A NetPlan
representing a WDM physical topologyoptionalLayerParameter
- Network layer (optional)public static DoubleMatrix1D getVectorNodeRegeneratorOccupancy(NetPlan netPlan, boolean countDownLightpathResources, NetworkLayer... optionalLayerParameter)
netPlan
- A NetPlan
representing a physical topologycountDownLightpathResources
- Wheter or not include lightpaths that are downoptionalLayerParameter
- Network layer (optional)public static boolean isNonConflictingRWA(List<Link> links, int[] seqWavelengths, DoubleMatrix2D wavelengthFiberOccupancy)
true
if the given sequence of wavelengths has not been allocated in the given sequence of links, false
otherwise.links
- Sequence of linksseqWavelengths
- Sequence of wavelengthswavelengthFiberOccupancy
- Occupied fibers in each wavelengthpublic static boolean isNonConflictingRWAPair(List<Link> linksPrimary, int[] seqWavelengthsPrimary, List<Link> linksBackup, int[] seqWavelengthsBackup, DoubleMatrix2D wavelengthFiberOccupancy)
true
if the given pair of sequences of wavelengths has not been allocated in the given pair of sequences of links, false
otherwise.linksPrimary
- Primary sequence of linksseqWavelengthsPrimary
- Primary sequence of wavelengthslinksBackup
- Backup sequence of linksseqWavelengthsBackup
- Backup sequence of wavelengthswavelengthFiberOccupancy
- Occupied fibers in each wavelengthpublic 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 int[] parseSeqWavelengthsInitialRoute(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<Link> seqFibers, int[] seqWavelengths, DoubleMatrix2D wavelengthFiberOccupancy, int[] seqRegenerators, DoubleMatrix1D nodeRegeneratorOccupancy)
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
- 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 removeLightpathAndUpdateOccupancy(ProtectionSegment lp, DoubleMatrix2D wavelengthFiberOccupancy)
lp
- Protection lightpath (as a protection segment)wavelengthFiberOccupancy
- Number of regenerators installed per nodepublic static void removeLightpathAndUpdateOccupancy(ProtectionSegment lp, DoubleMatrix2D wavelengthFiberOccupancy, DoubleMatrix1D nodeRegeneratorOccupancy)
lp
- Protection lightpath (as a protection segment)wavelengthFiberOccupancy
- Occupied fibers in each wavelengthnodeRegeneratorOccupancy
- Number of regenerators installed per nodepublic static void removeLightpathAndUpdateOccupancy(Route lp, DoubleMatrix2D wavelengthFiberOccupancy, boolean releaseResourcesOfOriginalRoute)
lp
- Lightpath (as a route)wavelengthFiberOccupancy
- Occupied fibers in each wavelengthreleaseResourcesOfOriginalRoute
- Wheter or not release the initial or the current resourcespublic static void removeLightpathAndUpdateOccupancy(Route lp, DoubleMatrix2D wavelengthFiberOccupancy, DoubleMatrix1D nodeRegeneratorOccupancy, boolean releaseResourcesOfOriginalRoute)
lp
- Lightpath (as a route)wavelengthFiberOccupancy
- Occupied fibers in each wavelengthnodeRegeneratorOccupancy
- Number of regenerators installed per nodereleaseResourcesOfOriginalRoute
- Wheter or not release the initial or the current resourcespublic static void setFiberNumWavelengths(Link fiber, int numWavelengths)
fiber
- Link fibernumWavelengths
- Number of wavelengths for the given fiberpublic static void setFibersNumWavelengths(NetPlan netPlan, int[] w_f, NetworkLayer... optionalLayerParameter)
netPlan
- A NetPlan
representing a WDM physical topologyoptionalLayerParameter
- Network layer (optional)w_f
- Number of wavelengths per fiberpublic static void setFibersNumWavelengths(NetPlan netPlan, int numWavelengths, NetworkLayer... optionalLayerParameter)
netPlan
- A NetPlan
representing a WDM physical topologynumWavelengths
- Number of wavelengths for all fibersoptionalLayerParameter
- Network layer (optional)public static void setLightpathSeqRegenerators(ProtectionSegment lp, int[] seqRegenerators)
lp
- Lightpath (as a protection segment)seqRegenerators
- 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(Route lp, int[] seqRegenerators)
lp
- Lightpath (as a route)seqRegenerators
- 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(ProtectionSegment lp, int[] seqWavelengths)
lp
- Lightpath (as a route)seqWavelengths
- Sequence of wavelengthspublic static void setLightpathSeqWavelengths(Route lp, int wavelengthId)
lp
- Lightpath (as a route)wavelengthId
- Wavelength identifier (the same for all traversed fibers)public static void setLightpathSeqWavelengths(Route lp, int[] seqWavelengths)
lp
- Lightpath (as a route)seqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)public static void setLightpathSeqWavelengthsInitialRoute(Route lp, int[] seqWavelengths)
lp
- Lightpath (as a route)seqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)public static void setProtectionLightpathSeqRegenerators(ProtectionSegment segment, int[] seqRegenerators)
segment
- Protection lightpathseqRegenerators
- 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(ProtectionSegment segment, int wavelengthId)
segment
- Protection lightpathwavelengthId
- Wavelength identifier (the same for all traversed fibers)public static void setProtectionLightpathSeqWavelengths(ProtectionSegment segment, int[] seqWavelengths)
segment
- Protection lightpathseqWavelengths
- Sequence of wavelengths (as many as the number of links in the lightpath)public static int[] WA_firstFit(List<Link> seqFibers, DoubleMatrix2D 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 output will be an empty array.
Important: wavelengthFiberOccupancy
is not updated, so
subsequent usage of allocateResources
method is encouraged.
seqFibers
- Sequence of traversed fiberswavelengthFiberOccupancy
- Occupied fibers in each wavelengthpublic static Pair<int[],int[]> WA_firstFitTwoRoutes(List<Link> seqFibers_1, List<Link> seqFibers_2, DoubleMatrix2D 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 output will be an empty array.
Important: wavelengthFiberOccupancy
is not updated, so
subsequent usage of allocateResources
method is encouraged.
seqFibers_1
- First sequence of traversed fibersseqFibers_2
- Second sequence of traversed fiberswavelengthFiberOccupancy
- Occupied fibers in each wavelengthpublic static Pair<int[],int[]> WA_RPP_firstFit(List<Link> seqFibers, DoubleMatrix2D wavelengthFiberOccupancy, DoubleMatrix1D l_f, DoubleMatrix1D 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.
seqFibers
- Sequence of traversed fiberswavelengthFiberOccupancy
- Occupied fibers in each wavelengthl_f
- Physical length in km per fibernodeRegeneratorOccupancy
- Number of regenerators installed per nodemaxRegeneratorDistanceInKm
- Maximum regeneration distance