Skip to content

Commit

Permalink
Change variable name to snake case
Browse files Browse the repository at this point in the history
  • Loading branch information
mgemaakbar committed Dec 23, 2024
1 parent 5cc816a commit 8ca5c70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mesa/examples/advanced/wolf_sheep/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ def __init__(

self.grid.add_property_layer(PropertyLayer.from_data("cliff", cliff_arr))

possibleCells = []
possible_cells = []
for cell in self.grid.all_cells.cells:
if (
cell.coordinate[0],
cell.coordinate[1],
) not in cliff_coord: # so we don't create wolf or sheep on cliff cells
possibleCells.append(cell)
possible_cells.append(cell)

# Create sheep:
Sheep.create_agents(
Expand All @@ -124,7 +124,7 @@ def __init__(
energy=self.rng.random((initial_sheep,)) * 2 * sheep_gain_from_food,
p_reproduce=sheep_reproduce,
energy_from_food=sheep_gain_from_food,
cell=self.random.choices(possibleCells, k=initial_sheep),
cell=self.random.choices(possible_cells, k=initial_sheep),
)
# Create Wolves:
Wolf.create_agents(
Expand All @@ -133,7 +133,7 @@ def __init__(
energy=self.rng.random((initial_wolves,)) * 2 * wolf_gain_from_food,
p_reproduce=wolf_reproduce,
energy_from_food=wolf_gain_from_food,
cell=self.random.choices(possibleCells, k=initial_wolves),
cell=self.random.choices(possible_cells, k=initial_wolves),
)

# Create grass patches if enabled
Expand Down

0 comments on commit 8ca5c70

Please sign in to comment.