Standardized order of events in a step and defining the first step #2229
Replies: 5 comments 16 replies
-
On the order of steps I think it's beneficial to have a "default" order things are normally done in a Mesa step. That makes it easier to teach and more consistent. My proposed standard order would be: def step():
self._advance_time() # Time is increased at the beginning of the step
self.agents.shuffle().do("step") # Do things during the step
self.datacollector.collect() # Collect data at the end of the step This way, a new day begins, you do stuff during the day, and at the end of the day you evaluate and collect your data. |
Beta Was this translation helpful? Give feedback.
-
On the count of steps For me, this makes the most sense:
This means, if you collect data at the end of the step, you get row 1 to N. If you also collect in the init you get row 0 to N. |
Beta Was this translation helpful? Give feedback.
-
@rht I’m curious, that’s your perspective on this? |
Beta Was this translation helpful? Give feedback.
-
How does your convention compare with numerically solving differential equations, where you have the initial conditions at t0 t0 = 0
t = t0
y = y0
# Evolve y, t by 1 step
y += f(x, t) * dt
# this must happen after the previous line, for Euler's method instead of backward Euler's method
t += dt If you instead use the Runge-Kutta method, the |
Beta Was this translation helpful? Give feedback.
-
We're having a call on this subject. Note that some of the discussion continues there: |
Beta Was this translation helpful? Give feedback.
-
This discussion is split of from
steps
counter #2223Background
There's a potential benefit in standardizing the order of events within a model step and determine what constitutes the first step in a simulation.
Points to consider
__init__
) be considered step 0 or step 1?Questions for discussion
Beta Was this translation helpful? Give feedback.
All reactions