Skip to content

Remove deprecated mesa.experimental.devs simulator module#3530

Merged
EwoutH merged 2 commits intomesa:mainfrom
EwoutH:remove_simulator
Mar 14, 2026
Merged

Remove deprecated mesa.experimental.devs simulator module#3530
EwoutH merged 2 commits intomesa:mainfrom
EwoutH:remove_simulator

Conversation

@EwoutH
Copy link
Copy Markdown
Member

@EwoutH EwoutH commented Mar 13, 2026

Summary

Removes the deprecated Simulator, ABMSimulator, and DEVSimulator classes and the entire mesa.experimental.devs package, completing the deprecation cycle started in Mesa 3.5.0.

Motive

The simulator classes were deprecated in 3.5.0 (#3277) when their functionality was replaced by public methods directly on Model: run_for(), run_until(), schedule_event(), and schedule_recurring(). Per our deprecation policy, deprecated features are removed in the next major release. This PR prepares for Mesa 4.0 by removing these legacy classes.

Implementation

  • Deleted mesa/experimental/devs/simulator.py and mesa/experimental/devs/__init__.py
  • Removed devs from mesa.experimental.__init__ exports
  • Removed the _simulator attribute and its TYPE_CHECKING import from Model
  • Removed Simulator reference from the Model docstring
  • Removed SimulatorController component and simulator parameter from SolaraViz
  • Simplified SolaraViz to always use ModelController instead of branching on simulator presence
  • Removed "simulator" from allowed parameter names in _check_model_params
  • Deleted tests/experimental/test_devs.py (463 lines of simulator-specific tests)
  • Removed simulator-related test from tests/test_model.py
  • Removed Devs section from docs/apis/experimental.md

Note that the core event system (Event, EventList, EventGenerator, Schedule, Priority) is not affected — it was already stabilized into mesa.time in 3.5.0 and remains fully functional.

Usage Examples

Users who were still on the deprecated API should migrate as documented in the migration guide:

# Old - ABMSimulator
from mesa.experimental.devs.simulator import ABMSimulator
simulator = ABMSimulator()
simulator.setup(model)
simulator.run_for(100)

# New
model.run_for(100)
# Old - DEVSimulator
from mesa.experimental.devs.simulator import DEVSimulator
simulator = DEVSimulator()
simulator.setup(model)
simulator.schedule_event_absolute(callback, time=10.5)
simulator.run_for(50)

# New
model.schedule_event(callback, at=10.5)
model.run_for(50)

Additional Notes

EwoutH added 2 commits March 13, 2026 13:37
Remove deprecated mesa.experimental.devs simulator module (Simulator, ABMSimulator, DEVSimulator) and all associated code. These classes were deprecated in Mesa 3.5.0 in favor of the public event scheduling and time advancement API on Model (run_for(), run_until(), schedule_event(), schedule_recurring()).

This removes the mesa/experimental/devs/ package, the _simulator attribute from Model, the simulator tests, and updates the experimental __init__.py and documentation accordingly.
Remove SimulatorController component and simulator parameter from SolaraViz. With the simulator classes removed, the visualization no longer needs a separate controller path, all models now use ModelController exclusively.
@EwoutH EwoutH requested review from Sahil-Chhoker and quaquel March 13, 2026 12:39
@github-actions

This comment was marked as off-topic.

@quaquel quaquel added the breaking Release notes label label Mar 14, 2026
@EwoutH EwoutH merged commit 04705d7 into mesa:main Mar 14, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants