-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
This issue is a spin-off of the discussion in #1942 (comment)
Background
Currently, Mesa models require users to explicitly increase the time and step counters using _advance_time()
. This approach can be unintuitive and prone to errors, especially for new users. It's also weird to have to use a private method to advance the time.
Motivation
We want to simplify the model creation process and reduce the potential for errors by automatically incrementing time and step counters. This change would make Mesa more user-friendly.
Simultaneously, the time-increase should be able to be overwritten if needed.
API proposal
I would propose the following user interface:
class Model:
...
def step(self, time=1, step=1):
...
The default is time=1
and step=1
. Users can change these numbers if they want, but they don't need to. If you want to turn both off, you can just say step(self, time=False, step=False)
, because in Python, the False
is interpreted as 0
.
Then we need to have one giant final battle if the time and step increases at the beginning of the step or the end of the step.
Curious what everybody thinks. If anyone has the golden bullet on an implementation idea, please share!