class Slotted(Schedule):
def __init__(self, slots, slot_sizes, capacitated=False, preemption=False):
"""
Initialises the instance of the Slotted Schedule object
"""
if not capacitated:
if preemption is not False:
raise ValueError("Pre-emption options not availale for non-capacitated slots.")
if preemption not in [False, 'resume', 'restart', 'resample']:
raise ValueError("Pre-emption options should be either 'resume', 'restart', 'resample', or False.")
self.schedule_type = 'slotted'
self.slots = slots
self.slot_sizes = slot_sizes
self.capacitated = capacitated
self.preemption = preemption
self.cyclelength = self.slots[-1]
self.c = 0
def initialise(self):
"""
Initialises the generator object at the beginning of a simulation
"""
self.schedule_generator = self.get_schedule_generator(self.slots, [self.slot_sizes[-1]] + self.slot_sizes[:-1])
self.get_next_slot()
def get_next_slot(self):
"""
Updates the next slot time and size from the generator
"""
date, size = next(self.schedule_generator)
self.next_slot_date = date
self.slot_size = size
I noticed this class in
schedules
:It does not appear in the documentation anywhere.