# Polymorphic scheduler

Automaticly polymorphic scheduler. It will automatically adapt to your scheduling requests, though at a slight overhead due to the indirection and statistics gathering. If you know what is your optimal scheduler, please choose this one. If the access pattern varies throughout the simulation, this scheduler is perfect for you. It will choose between the HeapSet and Minimal List scheduler.

Warning

Barely tested, certainly not with distribution and relocation!!! Use with caution!!!*

class pypdevs.schedulers.schedulerAuto.SchedulerAuto(models, epsilon, total_models)

  The polymorphic scheduler class

  __init__(models, epsilon, total_models)

    Constructor

    Parameters

      - models – the models to schedule

      - epsilon – the allowed deviation

  getImminent(time)

    Returns the imminent models for the provided time

    Parameters

      time – time to check for

  massReschedule(reschedule_set)

    Reschedule all models

    Parameters

      reschedule_set – the set of models to reschedule

  readFirst()

    Fetch the time of the first model

    Returns

      (time, age) – time of the first scheduled model

  schedule(model)

    Schedule a model

    Parameters

      model – the model to schedule

  swapSchedulerTo(scheduler)

    Swap the current subscheduler to the provided one. If the scheduler is already in use, no change happens.

    Parameters

      scheduler – the class to switch to

  unschedule(model)

    Unschedule a model

    Parameters

      model – the mode to unschedule