public class WDMUtils
extends java.lang.Object
Constructor and Description |
---|
WDMUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkConsistency(NetPlan physicalLayer,
java.util.Map<java.lang.String,java.lang.String> net2planParameters)
Performs extra checks to those applicable to every network design, especially
focused on WDM networks.
|
static int[] |
computeRegeneratorPositions(int[][] fiberTable,
int[] seqFibers,
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[] |
computeRegeneratorPositions(int[][] fiberTable,
int[] seqFibers,
int[] seqWavelengths,
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[] |
getFiberNumWavelengthsAttributes(NetPlan physicalLayer)
Returns the total number of wavelengths on each fiber.
|
static int[] |
getLightpathSeqRegeneratorsAttribute(NetPlan physicalLayer,
int lpId)
Returns the sequence of regenerators/wavelength converters for the given lightpath.
|
static int[] |
getLightpathSeqWavelengthsAttribute(NetPlan physicalLayer,
int lpId)
Returns the sequence of wavelengths for the given lightpath.
|
static java.util.List<int[]> |
getLightpathSeqWavelengthsAttributes(NetPlan physicalLayer)
Returns the sequence of wavelengths for each lighptath.
|
static int[] |
getProtectionLightpathSeqRegeneratorsAttribute(NetPlan physicalLayer,
int lpId)
Returns the sequence of regenerators/wavelength converters for the given lightpath.
|
static int[] |
getProtectionLightpathSeqWavelengthsAttribute(NetPlan physicalLayer,
int lpId)
Returns the sequence of wavelengths for a given protection lightpath.
|
static int[] |
getRegeneratorOccupancy(NetPlan physicalLayer)
Returns the number of regenerators installed per node.
|
static java.util.List<java.util.Set<java.lang.Integer>> |
getWavelengthOccupancy(NetPlan physicalLayer)
Returns the set of used wavelengths per fiber.
|
static void |
setFiberNumWavelengthsAttributes(NetPlan physicalLayer,
int numWavelengths)
Sets the number of wavelengths available on each fiber to the same value.
|
static void |
setFiberNumWavelengthsAttributes(NetPlan physicalLayer,
int[] w_f)
Sets the number of wavelengths available on each fiber.
|
static void |
setLightpathSeqRegeneratorsAttribute(NetPlan physicalLayer,
int lpId,
int[] seqRegenerators)
Sets the sequence of regenerators/wavelength converters for a given lightpath.
|
static void |
setLightpathSeqWavelengthsAttribute(NetPlan physicalLayer,
int lpId,
int wavelengthId)
Sets the current wavelength for the given lightpath, assuming no wavelength conversion.
|
static void |
setLightpathSeqWavelengthsAttribute(NetPlan physicalLayer,
int lpId,
int[] seqWavelengths)
Sets the sequence of wavelengths for the given lightpath.
|
static void |
setProtectionLightpathSeqRegeneratorsAttribute(NetPlan physicalLayer,
int lpId,
int[] seqRegenerators)
Sets the sequence of regenerators/wavelength converters for a given protection lightpath.
|
static void |
setProtectionLightpathSeqWavelengthsAttribute(NetPlan physicalLayer,
int lpId,
int wavelengthId)
Sets the sequence of wavelengths for a protection lightpath, assuming no wavelength conversion.
|
static void |
setProtectionLightpathSeqWavelengthsAttribute(NetPlan physicalLayer,
int lpId,
int[] seqWavelengths)
Sets the sequence of wavelengths for a protection lightpath.
|
static int[] |
WA_firstFit(int[][] fiberTable,
int[] seqFibers,
int[] w_f,
java.util.List<java.util.Set<java.lang.Integer>> wavelengthOccupancy)
Wavelength assignment algorithm based on a first-fit fashion.
|
static java.util.List<int[]> |
WA_firstFit(int[][] fiberTable,
java.util.List<int[]> lightpaths,
int[] w_f,
java.util.List<java.util.Set<java.lang.Integer>> wavelengthOccupancy)
Wavelength assignment algorithm based on a first-fit fashion.
|
static void |
WA_RPP_firstFit(int[][] fiberTable,
java.util.List<int[]> lightpaths,
int[] w_f,
java.util.List<java.util.Set<java.lang.Integer>> wavelengthOccupancy,
java.util.List<int[]> seqWavelengths,
double[] l_f,
int[] regeneratorOccupancy,
java.util.List<int[]> seqRegenerators,
double maxRegeneratorDistanceInKm)
Wavelength assignment algorithm based on a first-fit fashion assuming
full wavelength conversion and regeneration.
|
public static int[] getFiberNumWavelengthsAttributes(NetPlan physicalLayer)
physicalLayer
- A NetPlan
representing a WDM physical topologypublic static int[] getLightpathSeqRegeneratorsAttribute(NetPlan physicalLayer, int lpId)
physicalLayer
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierpublic static int[] getLightpathSeqWavelengthsAttribute(NetPlan physicalLayer, int lpId)
physicalLayer
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierpublic static java.util.List<int[]> getLightpathSeqWavelengthsAttributes(NetPlan physicalLayer)
physicalLayer
- A NetPlan
representing a WDM physical topologypublic static int[] getProtectionLightpathSeqRegeneratorsAttribute(NetPlan physicalLayer, int lpId)
physicalLayer
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierpublic static int[] getProtectionLightpathSeqWavelengthsAttribute(NetPlan physicalLayer, int lpId)
physicalLayer
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierpublic static void setFiberNumWavelengthsAttributes(NetPlan physicalLayer, int numWavelengths)
physicalLayer
- A NetPlan
representing a WDM physical topologynumWavelengths
- Number of wavelengths for all fiberspublic static void setFiberNumWavelengthsAttributes(NetPlan physicalLayer, int[] w_f)
physicalLayer
- A NetPlan
representing a WDM physical topologyw_f
- Number of wavelengths per fiberpublic static void setLightpathSeqRegeneratorsAttribute(NetPlan physicalLayer, int lpId, int[] seqRegenerators)
physicalLayer
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierseqRegenerators
- Sequence of regenerators/wavelength converters (as many as the number of links in the lightpath)public static void setLightpathSeqWavelengthsAttribute(NetPlan physicalLayer, int lpId, int[] seqWavelengths)
physicalLayer
- 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 setLightpathSeqWavelengthsAttribute(NetPlan physicalLayer, int lpId, int wavelengthId)
physicalLayer
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierwavelengthId
- Wavelength identifier for all traversed fiberspublic static void setProtectionLightpathSeqRegeneratorsAttribute(NetPlan physicalLayer, int lpId, int[] seqRegenerators)
physicalLayer
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierseqRegenerators
- Sequence of regenerators/wavelength converters (as many as the number of links in the lightpath)public static void setProtectionLightpathSeqWavelengthsAttribute(NetPlan physicalLayer, int lpId, int[] seqWavelengths)
physicalLayer
- 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 setProtectionLightpathSeqWavelengthsAttribute(NetPlan physicalLayer, int lpId, int wavelengthId)
physicalLayer
- A NetPlan
representing a WDM physical topologylpId
- Lightpath identifierwavelengthId
- Wavelength identifier for all traversed fiberspublic static void checkConsistency(NetPlan physicalLayer, java.util.Map<java.lang.String,java.lang.String> net2planParameters)
Performs extra checks to those applicable to every network design, especially focused on WDM networks.
physicalLayer
- A NetPlan
representing a WDM physical topologynet2planParameters
- A key-value map with Net2Plan
-wide configuration optionspublic static int[] computeRegeneratorPositions(int[][] fiberTable, int[] seqFibers, double[] l_f, double maxRegeneratorDistanceInKm)
fiberTable
- Set of installed fibers (first column: origin node, second column: destination node)seqFibers
- Sequence of fibers traversed by the lightpathl_f
- Physical length in km per fibermaxRegeneratorDistanceInKm
- Maximum regeneration distancepublic static int[] computeRegeneratorPositions(int[][] fiberTable, int[] seqFibers, int[] seqWavelengths, double[] l_f, double maxRegeneratorDistanceInKm)
fiberTable
- Set of installed fibers (first column: origin node, second column: destination node)seqFibers
- Sequence of fibers traversed by the lightpathseqWavelengths
- 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[] getRegeneratorOccupancy(NetPlan physicalLayer)
Returns the number of regenerators installed per node.
physicalLayer
- A NetPlan
representing a physical topologypublic static java.util.List<java.util.Set<java.lang.Integer>> getWavelengthOccupancy(NetPlan physicalLayer)
Returns the set of used wavelengths per fiber.
physicalLayer
- A NetPlan
representing a physical topologypublic static int[] WA_firstFit(int[][] fiberTable, int[] seqFibers, int[] w_f, java.util.List<java.util.Set<java.lang.Integer>> wavelengthOccupancy)
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.
fiberTable
- Set of installed fibers (first column: origin node, second column: destination node)seqFibers
- Sequence of traversed fibersw_f
- Number of wavelengths per fiberwavelengthOccupancy
- Set of used wavelengths per fiberpublic static java.util.List<int[]> WA_firstFit(int[][] fiberTable, java.util.List<int[]> lightpaths, int[] w_f, java.util.List<java.util.Set<java.lang.Integer>> wavelengthOccupancy)
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.
fiberTable
- Set of installed fibers (first column: origin node, second column: destination node)lightpaths
- Sequence of fibers traversed by each lightpathw_f
- Number of wavelengths per fiberwavelengthOccupancy
- Set of used wavelengths per fiberpublic static void WA_RPP_firstFit(int[][] fiberTable, java.util.List<int[]> lightpaths, int[] w_f, java.util.List<java.util.Set<java.lang.Integer>> wavelengthOccupancy, java.util.List<int[]> seqWavelengths, double[] l_f, int[] regeneratorOccupancy, java.util.List<int[]> seqRegenerators, 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.
fiberTable
- Set of installed fibers (first column: origin node, second column: destination node)lightpaths
- Sequence of fibers traversed by each lightpathw_f
- Number of wavelengths per fiberwavelengthOccupancy
- Set of used wavelengths per fiberseqWavelengths
- Sequence of wavelengths traversed by each lightpathl_f
- Physical length in km per fiberregeneratorOccupancy
- Number of regenerators installed per nodeseqRegenerators
- A vector with as many elements as traversed links in the route/segment. Each element is a 1 if an optical regenerator is used at the origin node of the corresponding link, and a 0 if not. First element is always 0maxRegeneratorDistanceInKm
- Maximum regeneration distance