NS-Gym Scheduler Module¶
- class ns_gym.schedulers.RandomScheduler(probability=0.5, start=0, end=inf, seed=None)[source]¶
Bases:
SchedulerRandom event scheduler: Events occur randomly with a given probability at each time step.
- Parameters:
probability (float) – The probability of an event occurring at each time step.
start (int, optional) – The start time for the scheduler. Defaults to 0.
end (int, optional) – The end time for the scheduler. Defaults to infinity.
seed (int, optional) – Random generator seed. Defaults to None.
- class ns_gym.schedulers.CustomScheduler(event_function, start=0, end=inf)[source]¶
Bases:
SchedulerCustom event scheduler: Allows for custom event logic based on a user-defined function.
- class ns_gym.schedulers.ContinuousScheduler(start=0, end=inf)[source]¶
Bases:
SchedulerContinuous Event Scheduler : At every time step return true
- class ns_gym.schedulers.DiscreteScheduler(event_list, start=0, end=inf)[source]¶
Bases:
SchedulerA discrete event scheduler returns a bool indicating where the system should transition at this time step
- Parameters:
event_list (set) – List of time steps to make a transition
- class ns_gym.schedulers.PeriodicScheduler(period, start=0, end=inf)[source]¶
Bases:
SchedulerPeriodic event scheduler: At periodic steps return true.
- Parameters:
period (int) – Period of event transition times.
- class ns_gym.schedulers.MemorylessScheduler(p, start=0, end=inf, seed=None)[source]¶
Bases:
SchedulerMemoryless Scheduler: Events happen at intervals according to a Geometric distribution
This scheduler models the number of trials that must be run before a success. The scheduler samples from a geometric distribution then records the new time an event will occur. After a transition we resample from the geometric distribution.
- Parameters:
p (float) – The probability of success of an individual trial.
seed (int, optional) – Random generator seed. Defaults to None.