Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and tpike3 committed Dec 11, 2024
1 parent 8897fc4 commit e922d29
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions mesa/examples/advanced/sugarscape_g1mt/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def __init__(
self.height = height
# Initiate population attributes


self.enable_trade = enable_trade
self.running = True

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e922d29

Please sign in to comment.