Deprecate Simulator classes, add migration guide entry#3277
Merged
Deprecate Simulator classes, add migration guide entry#3277
Conversation
93a0c4b to
4f0cfa6
Compare
|
Performance benchmarks:
|
Member
|
What's up with the failed tests? Is it just the depreciation warnings? |
quaquel
reviewed
Feb 11, 2026
Member
Author
Yes, I have supressed some expected once, and the remaining one disappears after the wolf-sheep example is updated (#3278). |
Document new Mesa 3.5 APIs for event scheduling and time advancement on Model. Adds examples for run_for/run_until (replacing step loops), schedule_event (at/after), and schedule_recurring (with Schedule and control via start/stop/count). Also documents deprecation of experimental Simulator classes with equivalent Model usages and notes that 3.5 is non-breaking but Mesa 4 will remove deprecated components.
Mark Simulator/ABMSimulator/DEVSimulator as deprecated in the module/class docstrings and add FutureWarning notices in ABMSimulator.__init__ and DEVSimulator.__init__. The messages point users to the new Model APIs (run_for, run_until, schedule_event, schedule_recurring) and the migration guide, and note removal in Mesa 4.0. No behavioral changes beyond emitting deprecation warnings.
c3d8b51 to
397b443
Compare
Member
Author
|
That's a lot of green! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deprecates the experimental
Simulator,ABMSimulator, andDEVSimulatorclasses in favor of the new public event scheduling API introduced in #3266. Adds corresponding migration guide entry.Implementation
FutureWarningtoABMSimulatorandDEVSimulator__init__methodsModelmethodsThe Simulators will be removed in Mesa 4.0. All functionality is now available directly on
Modelvia:model.run_for(duration)model.run_until(end_time)model.schedule_event(func, *, at, after)model.schedule_recurring(func, schedule)Migration Guide Entry
The guide shows:
run_for()andrun_until()at=andafter=ScheduleobjectsABMSimulatorandDEVSimulatorAdditional Notes
This deprecation is non-breaking, existing code using Simulators continues to work with warnings. The new API (#3266) will be available in Mesa 3.5, giving users one major version to migrate before removal in Mesa 4.0.
We could move more aggressive and directly remove it, which is allowed for experimental features in our deprecation policy, but this feature has been with us for a long time, so let's deprecate it gently.
Ref: Discussion #2921, PR #3266