-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfixes to DEVS #2478
Bugfixes to DEVS #2478
Conversation
for more information, see https://pre-commit.ci
and move force_update into do_step
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Performance benchmarks:
|
Thanks, really appreciated. Generally, it looks good. Let's wait for the benchmarks to confirm performance. Unrelated, but to confirm, the best practice is currently to define the |
Performance benchmarks:
|
Unfortunately, the performance degradation looks reproducible and significant. Any idea what causing it? |
Yes. If setup is called after events have been scheduled, you get an exception. So if |
yes: inccorrect behavior before. What happend was the following
Once I had the animation in #2470, the error was obvious. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know the root cause!
Also shows how valuable visual debugging can be.
absolutely |
Summary
This PR fixes several bugs in the experimental DEVS (Discrete Event Simulation) module and its usage in the wolf-sheep benchmark model. The changes improve initialization safety and timing consistency in event scheduling.
Motive
Several subtle bugs were discovered while working on #2470:
These issues needed to be addressed to ensure reliable event scheduling and simulation execution.
Implementation
The changes include:
Enhanced setup validation:
Moved simulator setup responsibility:
simulator.setup()
inside their__init__
Fixed ABMSimulator timing:
schedule_event_next_tick()
instead ofschedule_event_now()
steps
counter #2223Added
run_next_event()
method to support step-by-step simulation executionUsage Examples
Example of proper model initialization with DEVS:
Additional Notes