public class OpticalSpectrumManager extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
allocateOccupation(WLightpathUnregenerated lp,
Collection<WFiber> wdmLinks,
SortedSet<Integer> slotIds)
Accounts for the occupation of a lightpath, updating the information in the spectrum manager
|
void |
checkNetworkSlotOccupation()
Checks if the optical slot occupation --
|
static OpticalSpectrumManager |
createFromRegularLps(WNet net)
Creates this object, asociated to a given network
|
SortedSet<Integer> |
getAvailableSlotIds(Collection<WFiber> wdmLinks)
Returns the set of the optical slots ids that are idle in ALL the fibers provided
|
SortedSet<Integer> |
getIdleOpticalSlotIds(WFiber wdmLink)
Returns the optical slots that are usable (valid and idle) in the given fiber
|
static Pair<Integer,Integer> |
getMinimumAndMaximumValidSlotIdsInTheGrid(Collection<WFiber> wdmLinks)
For the provided collection of fibers, indicates the minimum and maximum optical slot id that is valid for all the
fibers in the collection
|
SortedSet<Integer> |
getOccupiedOpticalSlotIds(WFiber fiber)
Given a fiber, returns the set of optical slots occupied by at least one traversing lightpath
|
SortedMap<Integer,SortedSet<WLightpathUnregenerated>> |
getOccupiedResources(WFiber fiber)
Given a fiber, returns a map with the occupied optical slot ids, mapped to the set of lightpaths that occupy it.
|
SortedMap<WFiber,SortedSet<Integer>> |
getOccupiedResources(WLightpathRequest lp)
Given a lightpath request, returns the optical slots occupied in the traversed fibers
|
List<List<WFiber>> |
getRegenerationPoints(List<WFiber> seqFibers,
double maxUnregeneratedDistanceInKm)
Given a sequence of fibers (i.e.
|
boolean |
isAllocatable(Collection<WFiber> wdmLinks,
SortedSet<Integer> slotIds)
Given a set of fibers and a set of optical slots, returns true if ALL the optical slots are idle in ALL the fibers
|
boolean |
isAlreadyAccounted(WLightpathUnregenerated lp)
Returns true if the indicated lightpath is already accounted in this optical spectrm manager.
|
boolean |
isOpticalSlotIdsValidAndIdle(WFiber wdmLink,
SortedSet<Integer> slotsIds)
Indicates if the optical slots are usable (valid and idle) in the given fiber
|
boolean |
isSpectrumOccupationOk()
Returns true if the design is ok respect to spectrum occupation: no optical slot in any fiber is occupied by more than one
lightpath, and no optical slot in a fiber is outside the valid range for that fiber
|
String |
printReport()
Prints a report with the occupation (for debugging pruposes)
|
void |
releaseOccupation(WLightpathUnregenerated lp)
Releases all the optical slots occupied for a given lightpath in this manager
|
Optional<SortedSet<Integer>> |
spectrumAssignment_firstFit(Collection<WFiber> seqFibers,
int numContiguousSlotsRequired,
Optional<Integer> minimumInitialSlotId)
Searches for a first-fit assignment.
|
Optional<Pair<SortedSet<Integer>,SortedSet<Integer>>> |
spectrumAssignment_firstFitTwoRoutes(Collection<WFiber> seqFibers_1,
Collection<WFiber> seqFibers_2,
int numContiguousSlotsRequired)
Searches for a first-fit assignment for the two given paths, so optical slots can be different for each.
|
public boolean allocateOccupation(WLightpathUnregenerated lp, Collection<WFiber> wdmLinks, SortedSet<Integer> slotIds)
lp
- the lightpathwdmLinks
- the set of fibers where optical resources are occupied by this lightpath. This is typically the set of
lightpath traversed fibers. In filterless technologies, this may also include other fibers not intentionally traversed,
but where the spectrum is also occupiedslotIds
- the optical slot idspublic void checkNetworkSlotOccupation()
public static OpticalSpectrumManager createFromRegularLps(WNet net)
net
- the networkpublic SortedSet<Integer> getAvailableSlotIds(Collection<WFiber> wdmLinks)
wdmLinks
- the set of fiberspublic SortedSet<Integer> getIdleOpticalSlotIds(WFiber wdmLink)
wdmLink
- see abovepublic static Pair<Integer,Integer> getMinimumAndMaximumValidSlotIdsInTheGrid(Collection<WFiber> wdmLinks)
wdmLinks
- see abovepublic SortedSet<Integer> getOccupiedOpticalSlotIds(WFiber fiber)
fiber
- see abovepublic SortedMap<Integer,SortedSet<WLightpathUnregenerated>> getOccupiedResources(WFiber fiber)
fiber
- the input fiberpublic SortedMap<WFiber,SortedSet<Integer>> getOccupiedResources(WLightpathRequest lp)
lp
- the lightpath requestpublic List<List<WFiber>> getRegenerationPoints(List<WFiber> seqFibers, double maxUnregeneratedDistanceInKm)
seqFibers
- see abovemaxUnregeneratedDistanceInKm
- see abovepublic boolean isAllocatable(Collection<WFiber> wdmLinks, SortedSet<Integer> slotIds)
wdmLinks
- the fibersslotIds
- the optical slotspublic boolean isAlreadyAccounted(WLightpathUnregenerated lp)
lp
- the lightpathpublic boolean isOpticalSlotIdsValidAndIdle(WFiber wdmLink, SortedSet<Integer> slotsIds)
wdmLink
- see aboveslotsIds
- see abovepublic boolean isSpectrumOccupationOk()
public String printReport()
public void releaseOccupation(WLightpathUnregenerated lp)
lp
- the lightpathpublic Optional<SortedSet<Integer>> spectrumAssignment_firstFit(Collection<WFiber> seqFibers, int numContiguousSlotsRequired, Optional<Integer> minimumInitialSlotId)
seqFibers
- see abovenumContiguousSlotsRequired
- see aboveminimumInitialSlotId
- see abovepublic Optional<Pair<SortedSet<Integer>,SortedSet<Integer>>> spectrumAssignment_firstFitTwoRoutes(Collection<WFiber> seqFibers_1, Collection<WFiber> seqFibers_2, int numContiguousSlotsRequired)
seqFibers_1
- see aboveseqFibers_2
- see abovenumContiguousSlotsRequired
- see aboveCopyright © 2018. All rights reserved.