Skip to content

Commit

Permalink
fix: Ensure schedule.steps is always incremented before data collection
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Jan 24, 2024
1 parent cf38477 commit 479eaf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/sugarscape_g1mt/sugarscape_g1mt/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ def step(self):

if not self.enable_trade:
# If trade is not enabled, return early
self.schedule.steps += (
1 # important for data collector to track number of steps
)
self.datacollector.collect(self)
return

Expand Down

0 comments on commit 479eaf3

Please sign in to comment.