Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mesa/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def __new__(cls, *args: Any, **kwargs: Any) -> Any:
# advance.
obj._seed = random.random() # noqa: S311
obj.random = random.Random(obj._seed)
# TODO: Remove these 2 lines just before Mesa 3.0
obj._steps = 0
obj._time = 0
Comment on lines +60 to +62
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remind me why we need to remove these lines? Seems like the time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because they are already specified in __init__. This was a hack to people who forget to super().__init__ their model.

return obj

def __init__(self, *args: Any, **kwargs: Any) -> None:
Expand Down