diff --git a/examples/bank_reserves/bank_reserves/agents.py b/examples/bank_reserves/bank_reserves/agents.py index 41fa1bf0..eb953ab3 100644 --- a/examples/bank_reserves/bank_reserves/agents.py +++ b/examples/bank_reserves/bank_reserves/agents.py @@ -65,7 +65,9 @@ def __init__(self, model, moore, bank, rich_threshold): def do_business(self): """check if person has any savings, any money in wallet, or if the bank can loan them any money""" - if (self.savings > 0 or self.wallet > 0 or self.bank.bank_to_loan > 0) and len(self.cell.agents) > 1: + if (self.savings > 0 or self.wallet > 0 or self.bank.bank_to_loan > 0) and len( + self.cell.agents + ) > 1: # create list of people at my location (includes self) # set customer to self for while loop condition customer = self diff --git a/examples/bank_reserves/batch_run.py b/examples/bank_reserves/batch_run.py index b7d338fd..dfbbefb1 100644 --- a/examples/bank_reserves/batch_run.py +++ b/examples/bank_reserves/batch_run.py @@ -23,6 +23,7 @@ directory from which Python was run. The CSV file will contain the data from every step of every run. """ + import itertools import mesa import pandas as pd diff --git a/examples/hex_snowflake/hex_snowflake/cell.py b/examples/hex_snowflake/hex_snowflake/cell.py index 1015da30..f68223a7 100644 --- a/examples/hex_snowflake/hex_snowflake/cell.py +++ b/examples/hex_snowflake/hex_snowflake/cell.py @@ -1,4 +1,3 @@ - from mesa.experimental.cell_space import FixedAgent diff --git a/examples/pd_grid/pd_grid/agent.py b/examples/pd_grid/pd_grid/agent.py index 9223d284..4890b749 100644 --- a/examples/pd_grid/pd_grid/agent.py +++ b/examples/pd_grid/pd_grid/agent.py @@ -1,4 +1,3 @@ - from mesa.experimental.cell_space import CellAgent @@ -31,7 +30,7 @@ def step(self): if better than own score.""" # neighbors = self.model.grid.get_neighbors(self.pos, True, include_center=True) - neighbors = [*list(self.cell.neighborhood.agents), self] + neighbors = [*list(self.cell.neighborhood.agents), self] best_neighbor = max(neighbors, key=lambda a: a.score) self.next_move = best_neighbor.move diff --git a/examples/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py b/examples/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py index 816e3889..d9f27694 100644 --- a/examples/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py +++ b/examples/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py @@ -1,4 +1,3 @@ - from mesa.experimental.cell_space import FixedAgent diff --git a/examples/wolf_sheep/wolf_sheep/agents.py b/examples/wolf_sheep/wolf_sheep/agents.py index f93dd1e2..8e71988b 100644 --- a/examples/wolf_sheep/wolf_sheep/agents.py +++ b/examples/wolf_sheep/wolf_sheep/agents.py @@ -1,4 +1,3 @@ - from mesa.experimental.cell_space import CellAgent, FixedAgent