public class FlexGridUtils
extends java.lang.Object
| Constructor and Description |
|---|
FlexGridUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<Pair<java.lang.Integer,java.lang.Integer>> |
computeAvailableSpectrumVoids(boolean[] slotAvailabilityVector)
Computes the list of spectral voids (list of available contiguous slots)
from a slot availability vector of a path.
|
static int |
computeMaximumRequests(java.util.List<Pair<java.lang.Integer,java.lang.Integer>> availableSpectrumVoids,
int numSlots)
Computes the maximum number of requests (each one measured in number of slots) which
can be allocated in a set of spectrum voids.
|
static int |
computeNumberOfSlots(double bandwidthInGbps,
double slotGranularityInGHz,
double guardBandInGHz,
ModulationFormatUtils.ModulationFormat modulationFormat)
Computes the number of frequency slots required for a certain amount of
bandwidth (measured in Gbps), including guard-bands.
|
static boolean[] |
computePathSlotAvailabilityVector(int[] seqFibers,
boolean[][] slotAvailabilityMatrix)
Computes the slot availability vector of a path, represented by a sequence
of fibers, where each position indicates whether or not its corresponding
frequency slot is available along the path.
|
static void |
main(java.lang.String[] args)
Main method to test this class.
|
public static void main(java.lang.String[] args)
args - Command-line arguments (unused)public static java.util.List<Pair<java.lang.Integer,java.lang.Integer>> computeAvailableSpectrumVoids(boolean[] slotAvailabilityVector)
Computes the list of spectral voids (list of available contiguous slots) from a slot availability vector of a path.
slotAvailabilityVector - Slot availability vector, where each position indicates whether or not its corresponding frequency slot is available along the pathpublic static int computeMaximumRequests(java.util.List<Pair<java.lang.Integer,java.lang.Integer>> availableSpectrumVoids, int numSlots)
availableSpectrumVoids - List of available spectrum voids (first item of each pair is the initial slot identifier, whereas the second one is the number of consecutive slots)numSlots - Number of required slots for a reference connectionpublic static int computeNumberOfSlots(double bandwidthInGbps,
double slotGranularityInGHz,
double guardBandInGHz,
ModulationFormatUtils.ModulationFormat modulationFormat)
bandwidthInGbps - Requested bandwidth (in Gbps)slotGranularityInGHz - Slot granularity (in GHz)guardBandInGHz - Guard-band size (in GHz)modulationFormat - Modulation formatpublic static boolean[] computePathSlotAvailabilityVector(int[] seqFibers,
boolean[][] slotAvailabilityMatrix)
Computes the slot availability vector of a path, represented by a sequence of fibers, where each position indicates whether or not its corresponding frequency slot is available along the path.
Important: Loop-free paths should be employed, but it is not checked by the method.
seqFibers - (Loop-free) Sequence of traversed fibersslotAvailabilityMatrix - An ExS matrix, where each element a_es is equal to true if the frequency slot s is available on fiber e; otherwise, false