-
Notifications
You must be signed in to change notification settings - Fork 47
feat(mettagrid): add events system core infrastructure #4954
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
base: 01-16-refactor_mettagrid_remove_clipper_system
Are you sure you want to change the base?
feat(mettagrid): add events system core infrastructure #4954
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
packages/mettagrid/python/src/mettagrid/config/mettagrid_config.py
Outdated
Show resolved
Hide resolved
78c9396 to
adf7819
Compare
aa99928 to
4c32137
Compare
adf7819 to
4809cc6
Compare
166d42d to
7643db3
Compare
3562405 to
653be6e
Compare
7643db3 to
7d6268b
Compare
653be6e to
c9aa87b
Compare
7d6268b to
a726bae
Compare
a726bae to
f9a8d61
Compare
c9aa87b to
e1f2146
Compare
f9a8d61 to
4fca1f2
Compare
4fca1f2 to
17b2c02
Compare
e1f2146 to
a8ff769
Compare
17b2c02 to
f4d22bd
Compare
| std::sort(_schedule.begin(), _schedule.end(), [](const auto& a, const auto& b) { return a.first < b.first; }); | ||
| } | ||
|
|
||
| std::vector<Event*> EventScheduler::get_events_for_timestep(int timestep) { |
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.
we don't need to get events, we can just execute them. then we don't need to return a vector
…of returning vector Address review feedback: simplify the interface by having process_timestep() apply events directly to targets instead of returning a vector of events. This avoids the vector allocation overhead and simplifies the calling code. - Rename get_events_for_timestep() to process_timestep() - process_timestep() takes a callback to get targets and applies events directly - Returns the count of events that fired Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
f4d22bd to
c2870e9
Compare

Add EventConfig class for timestep-based events that apply mutations
to filtered objects. Events can target any GridObject and include:
Includes helper functions:
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com