Skip to content

Commit

Permalink
Update benchmarks to use shuffle_do()
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutH committed Sep 21, 2024
1 parent 86a07d8 commit 6e25c2a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion benchmarks/BoltzmannWealth/boltzmann_wealth.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, seed=None, n=100, width=10, height=10):

def step(self):
"""Run the model for a single step."""
self.agents.shuffle().do("step")
self.agents.shuffle_do("step")
# collect data
self.datacollector.collect(self)

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/WolfSheep/wolf_sheep.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ def __init__(

def step(self):
"""Run one step of the model."""
self.agents_by_type[Sheep].shuffle(inplace=True).do("step")
self.agents_by_type[Wolf].shuffle(inplace=True).do("step")
self.agents_by_type[Sheep].shuffle_do("step")
self.agents_by_type[Wolf].shuffle_do("step")


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion mesa/experimental/devs/examples/epstein_civil_violence.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def __init__(

def step(self):
"""Run one step of the model."""
self.active_agents.shuffle(inplace=True).do("step")
self.active_agents.shuffle_do("step")


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions mesa/experimental/devs/examples/wolf_sheep.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ def __init__(

def step(self):
"""Perform one step of the model."""
self.agents_by_type[Sheep].shuffle(inplace=True).do("step")
self.agents_by_type[Wolf].shuffle(inplace=True).do("step")
self.agents_by_type[Sheep].shuffle_do("step")
self.agents_by_type[Wolf].shuffle_do("step")


if __name__ == "__main__":
Expand Down

0 comments on commit 6e25c2a

Please sign in to comment.