Skip to content

Stabilize event scheduling system from experimental to mesa.time#3276

Merged
EwoutH merged 2 commits intomesa:mainfrom
EwoutH:stabilize_events
Feb 11, 2026
Merged

Stabilize event scheduling system from experimental to mesa.time#3276
EwoutH merged 2 commits intomesa:mainfrom
EwoutH:stabilize_events

Conversation

@EwoutH
Copy link
Copy Markdown
Member

@EwoutH EwoutH commented Feb 11, 2026

Summary

Move the event scheduling functionality from mesa.experimental.devs.eventlist to a new stable mesa.time module. This stabilizes the event-based simulation system that was introduced experimentally and makes it a first-class feature of Mesa.

Also renames SimulationEvent to Event.

Motive

The event scheduling system (EventList, SimulationEvent, EventGenerator, Schedule, Priority) has been in experimental status since its introduction. After extensive testing and usage, it's ready to be stabilized and made part of Mesa's core API. This promotes better time management in agent-based models and supports both discrete event simulation and hybrid approaches.

Usage Examples

The event scheduling system can now be imported from the stable namespace:

from mesa.time import EventList, SimulationEvent, Priority, Schedule, EventGenerator

# Schedule a one-time event
model.schedule_event(my_function, at=5.0, priority=Priority.HIGH)

# Schedule recurring events
schedule = Schedule(interval=1.0, start=0.0)
model.schedule_recurring(my_function, schedule, priority=Priority.DEFAULT)

# Use event generators for complex recurring patterns
generator = EventGenerator(model, my_function, schedule).start()

All existing functionality remains unchanged, this is purely a reorganization to stabilize the API.

Additional Notes

  • This is a non-breaking change for users already using the experimental API (imports from mesa.experimental.devs.eventlist still work via the simulator module's imports)
  • The Simulator classes remain in experimental status (and will be deprecated and removed in follow-up PRs)
  • All tests pass with updated imports
  • Documentation has been updated to reflect the new stable location
  • Follows Mesa's deprecation policy by providing the alternative before any deprecation warnings

Follows #3201, #3204 and #3266, discussed in #2921, part of #3132.

@EwoutH EwoutH requested a review from quaquel February 11, 2026 12:10
@EwoutH EwoutH added the maintenance Release notes label label Feb 11, 2026
@github-actions
Copy link
Copy Markdown

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 -2.1% [-3.1%, -1.1%] 🔵 +0.1% [-0.0%, +0.2%]
BoltzmannWealth large 🔵 -0.7% [-1.4%, +0.0%] 🔵 +1.1% [-0.4%, +2.6%]
Schelling small 🔵 -0.8% [-1.3%, -0.4%] 🔵 +1.0% [+0.9%, +1.2%]
Schelling large 🔵 -1.0% [-1.6%, -0.5%] 🔵 +2.0% [+0.4%, +3.7%]
WolfSheep small 🔵 -0.4% [-0.7%, -0.1%] 🔵 +0.3% [+0.1%, +0.5%]
WolfSheep large 🔵 +4.7% [+2.6%, +6.4%] 🔴 +7.3% [+4.0%, +10.4%]
BoidFlockers small 🔵 -1.1% [-1.4%, -0.6%] 🔵 +0.4% [+0.1%, +0.6%]
BoidFlockers large 🔵 -0.9% [-1.4%, -0.3%] 🔵 -0.1% [-0.4%, +0.1%]

Copy link
Copy Markdown
Member

@quaquel quaquel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment, but looks fine to me otherwise.

Move the event scheduling functionality from `mesa.experimental.devs.eventlist` to a new stable `mesa.time` module. This stabilizes the event-based simulation system that was introduced experimentally and makes it a first-class feature of Mesa.

The event scheduling system (EventList, SimulationEvent, EventGenerator, Schedule, Priority) has been in experimental status since its introduction. After extensive testing and usage, it's ready to be stabilized and made part of Mesa's core API. This promotes better time management in agent-based models and supports both discrete event simulation and hybrid approaches.
EwoutH added a commit that referenced this pull request Feb 11, 2026
@EwoutH EwoutH merged commit 7f97688 into mesa:main Feb 11, 2026
15 checks passed
@EwoutH
Copy link
Copy Markdown
Member Author

EwoutH commented Feb 11, 2026

Just realized I didn't update the test file, that's still in tests/experimental/test_devs.py.

Once we remove the simulators, I will clean it up and move/rename to tests/time/test_events.py.

@EwoutH EwoutH mentioned this pull request Feb 11, 2026
42 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants