Skip to content

[Feature]: Automatic increase of step counter #116

@adamamer20

Description

@adamamer20

🤔 Problem Description

In Mesa 3.0 now automatically the steps counter is now automatically increased.

With each call to Model.steps() it's increased by 1, at the beginning of the step.

You can access it by Model.steps, and it's internally in the datacollector, batchrunner and the visualisation.

We should replicate this in mesa-frames to make the behavior consistent across the two.

💡 Proposed Solution

Introduce a new steps property in the ModelDF class that references an internal attribute _steps.

  • Initialize _steps to 0 when a ModelDF instance is created.
  • Each call to ModelDF.step() should automatically increment _steps by 1 at the beginning of the method execution.
  • Expose the steps property to provide external access to the current step count.

🔄 Alternatives Considered

No response

➕ Additional Context

No response

Metadata

Metadata

Assignees

Labels

featureNew functionality added to the project.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions