Skip to content

Commit

Permalink
rename step to run_next_event
Browse files Browse the repository at this point in the history
  • Loading branch information
quaquel committed Nov 9, 2024
1 parent 29479ee commit 835b985
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mesa/experimental/devs/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def run_until(self, end_time: int | float) -> None:
self._schedule_event(event) # reschedule event
break

def step(self):
def run_next_event(self):
"""Execute the next event.
Raises:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_devs.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ def test_devs_simulator():

fn = MagicMock()
simulator.schedule_event_absolute(fn, 1.0)
simulator.step()
simulator.run_next_event()
fn.assert_called_once()
assert simulator.time == 1.0
simulator.step()
simulator.run_next_event()
assert simulator.time == 1.0

simulator = DEVSimulator()
with pytest.raises(Exception):
simulator.step()
simulator.run_next_event()

# cancel_event
simulator = DEVSimulator()
Expand Down

0 comments on commit 835b985

Please sign in to comment.