mirror of
https://github.com/gsi-upm/soil
synced 2024-11-14 07:22:29 +00:00
a1262edd2a
Treating time and conditions as the same entity was getting confusing, and it added a lot of unnecessary abstraction in a critical part (the scheduler). The scheduling queue now has the time as a floating number (faster), the agent id (for ties) and the condition, as well as the agent. The first three elements (time, id, condition) can be considered as the "key" for the event. To allow for agent execution to be "randomized" within every step, a new parameter has been added to the scheduler, which makes it add a random number to the key in order to change the ordering. `EventedAgent.received` now checks the messages before returning control to the user by default. |
||
---|---|---|
.. | ||
basic | ||
improved | ||
README.md |
There are two similar implementations of this simulation.
basic
. Using simple primitesimproved
. Using more advanced features such as thetime
module to avoid unnecessary computations (i.e., skip steps), and generator functions.
The examples can be run directly in the terminal, and they accept command like arguments.
For example, to enable the CSV exporter and the Summary exporter, while setting max_time
to 100
and seed
to CustomSeed
:
python rabbit_agents.py --set max_time=100 --csv -e summary --set 'seed="CustomSeed"'
To learn more about how this functionality works, check out the soil.easy
function.