diff --git a/mesa/examples/advanced/sugarscape_g1mt/model.py b/mesa/examples/advanced/sugarscape_g1mt/model.py index 01ca631e5fe..c116de0fd84 100644 --- a/mesa/examples/advanced/sugarscape_g1mt/model.py +++ b/mesa/examples/advanced/sugarscape_g1mt/model.py @@ -60,7 +60,6 @@ def __init__( self.height = height # Initiate population attributes - self.enable_trade = enable_trade self.running = True @@ -91,16 +90,27 @@ def __init__( max_spice = spice_distribution[cell.coordinate] Resource(self, max_sugar, max_spice, cell) - Trader.create_agents(self, initial_population, - self.random.choices(self.grid.all_cells.cells, k=initial_population), - sugar=self.rng.integers(endowment_min, endowment_max, (initial_population, ), endpoint=True), - spice=self.rng.integers(endowment_min, endowment_max, (initial_population, ), endpoint=True), - metabolism_sugar=self.rng.integers(metabolism_min, metabolism_max, (initial_population, ), endpoint=True), - metabolism_spice=self.rng.integers(metabolism_min, metabolism_max, (initial_population, ), endpoint=True), - vision=self.rng.integers(vision_min, vision_max, (initial_population, ), endpoint=True), + Trader.create_agents( + self, + initial_population, + self.random.choices(self.grid.all_cells.cells, k=initial_population), + sugar=self.rng.integers( + endowment_min, endowment_max, (initial_population,), endpoint=True + ), + spice=self.rng.integers( + endowment_min, endowment_max, (initial_population,), endpoint=True + ), + metabolism_sugar=self.rng.integers( + metabolism_min, metabolism_max, (initial_population,), endpoint=True + ), + metabolism_spice=self.rng.integers( + metabolism_min, metabolism_max, (initial_population,), endpoint=True + ), + vision=self.rng.integers( + vision_min, vision_max, (initial_population,), endpoint=True + ), ) - def step(self): """ Unique step function that does staged activation of sugar and spice