Event Interval Generator#
- class airlift.envs.events.event_interval_generator.EventInterval(num_broken_steps)#
- num_broken_steps: int#
Alias for field number 0
- class airlift.envs.events.event_interval_generator.EventIntervalGenerator(min_duration: int, max_duration: int)#
Generates an interval that a route can go offline. This generator can be used for making anything in the environment unavailable from min to max steps inclusive. At the moment it is only being utilized to manage routes becoming unavailable. This generator is based upon the Flatland Train Malfunction generator and uses poisson distribution as defined in the EventGenerator class.
- generate() EventInterval #
Generates an Event with an Interval from min duration to max duration
- Returns:
EventInterval: a NamedTuple that contains the number of steps something will become unavailable for. The number of steps is 0 of an interval wasn’t generated.
- class airlift.envs.events.event_interval_generator.NoEventIntervalGen#
Used when items that utilize the EventIntervalGenerator are toggled off.
- generate()#
Generates an Event with an Interval from min duration to max duration
- Returns:
EventInterval: a NamedTuple that contains the number of steps something will become unavailable for. The number of steps is 0 of an interval wasn’t generated.