Changes the Activity and Simulation classes to use the events provided by simpy for there start and stop conditions. Also adds a reservation system to the container used by HasContainer, replacing the total_requested field with a more robust system.
Changes to the Activity class:
The Condition classes have been removed, as well as the start_condition and stop_condition parameters. These parameters have been replaced with a start_event and stop_event. To get an even similar to the "LevelCondition", use the new "container.empty_event" and "container.full_event" properties on a HasContainer object. To get an event similar to the "TimeCondition", the simpy built-in Timeout event can be used (can be obtained through "env.timeout(...)"). Several events can be combined through the simpy built-in AllOf or AnyOf events (can be obtained through "env.any_of(events=[event1, event2, ...])" or "env.all_of(events=[event1, event2, ...])").
todo:
[x] add a unit test of a relay case: one activity bringing from container1 to container2 and another activity transporting from container2 to container3.
[x] refactor the Simulation and Activity classes to use as much of the same methods for their process as possible
[x] update the example notebooks to the new Activity interface.
[x] fix the test_infinite_loop test in test_server
Changes the Activity and Simulation classes to use the events provided by simpy for there start and stop conditions. Also adds a reservation system to the container used by HasContainer, replacing the total_requested field with a more robust system.
Changes to the Activity class: The Condition classes have been removed, as well as the start_condition and stop_condition parameters. These parameters have been replaced with a start_event and stop_event. To get an even similar to the "LevelCondition", use the new "container.empty_event" and "container.full_event" properties on a HasContainer object. To get an event similar to the "TimeCondition", the simpy built-in Timeout event can be used (can be obtained through "env.timeout(...)"). Several events can be combined through the simpy built-in AllOf or AnyOf events (can be obtained through "env.any_of(events=[event1, event2, ...])" or "env.all_of(events=[event1, event2, ...])").
todo: