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 quaquel committed Oct 12, 2024
1 parent 480cdb4 commit c433382
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/wolf_sheep/wolf_sheep/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(
grass=False,
grass_regrowth_time=30,
sheep_gain_from_food=4,
seed=None
seed=None,
):
"""
Create a new Wolf-Sheep model with the given parameters.
Expand Down Expand Up @@ -93,14 +93,16 @@ def __init__(
x = self.random.randrange(self.width)
y = self.random.randrange(self.height)
energy = self.random.randrange(2 * self.sheep_gain_from_food)
Sheep(self, energy, sheep_reproduce, sheep_gain_from_food, self.grid[(x,y)])
Sheep(
self, energy, sheep_reproduce, sheep_gain_from_food, self.grid[(x, y)]
)

# Create wolves
for _ in range(self.initial_wolves):
x = self.random.randrange(self.width)
y = self.random.randrange(self.height)
energy = self.random.randrange(2 * self.wolf_gain_from_food)
Wolf(self, energy, wolf_reproduce, wolf_gain_from_food, self.grid[(x,y)])
Wolf(self, energy, wolf_reproduce, wolf_gain_from_food, self.grid[(x, y)])

# Create grass patches
if self.grass:
Expand Down

0 comments on commit c433382

Please sign in to comment.