Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mesa/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from __future__ import annotations

import heapq
import warnings
from collections import defaultdict

# mypy
Expand Down Expand Up @@ -379,6 +380,13 @@ def __init__(self, model: Model, time_step: TimeT = 1) -> None:
self.event_queue: list[tuple[TimeT, float, Agent]] = []
self.time_step: TimeT = time_step # Fixed time period for each step

warnings.warn(
"The DiscreteEventScheduler is experimental. It may be changed or removed in any and all future releases, including patch releases.\n"
"We would love to hear what you think about this new feature. If you have any thoughts, share them with us here: https://github.com/projectmesa/mesa/discussions/1923",
FutureWarning,
stacklevel=2,
)

def schedule_event(self, time: TimeT, agent: Agent) -> None:
"""Schedule an event for an agent at a specific time."""
if time < self.time:
Expand Down