Minimal List scheduler¶
The Minimal List scheduler is the simplest scheduler available, though it has extremely bad performance in most cases.
It simply keeps a list of all models. As soon as a reschedule happens, the list is checked for the minimal value, which is stored. When the imminent models are requested, the lowest value that was found is used to immediatelly return [], or it iterates the complete list in search of models that qualify.
- class pypdevs.schedulers.schedulerML.SchedulerML(models, epsilon, total_models)[source]¶
Scheduler class itself
- __init__(models, epsilon, total_models)[source]¶
Constructor
- Parameters
models – all models in the simulation
- getImminent(time)[source]¶
Returns a list of all models that transition at the provided time, with the specified epsilon deviation allowed.
- Parameters
time – timestamp to check for models
Warning
For efficiency, this method only checks the first elements, so trying to invoke this function with a timestamp higher than the value provided with the readFirst method, will always return an empty set.
- massReschedule(reschedule_set)[source]¶
Reschedule all models provided. Equivalent to calling unschedule(model); schedule(model) on every element in the iterable.
- Parameters
reschedule_set – iterable containing all models to reschedule