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] committed Oct 12, 2024
1 parent 4ad5bb5 commit 3e54f28
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/sugarscape_cg/sugarscape_cg/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from mesa.experimental.cell_space import FixedAgent, CellAgent


def get_distance(cell_1, cell_2):
"""Get the distance between two point
Expand Down
2 changes: 1 addition & 1 deletion examples/sugarscape_cg/sugarscape_cg/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, width=50, height=50, initial_population=100, seed=None):
sugar = self.random.randrange(6, 25)
metabolism = self.random.randrange(2, 4)
vision = self.random.randrange(1, 6)
cell = self.grid[(x,y)]
cell = self.grid[(x, y)]
SsAgent(self, cell, sugar, metabolism, vision)

self.running = True
Expand Down
3 changes: 1 addition & 2 deletions examples/sugarscape_g1mt/sugarscape_g1mt/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(
self.running = True

# initiate mesa grid class
self.grid =OrthogonalVonNeumannGrid((self.width, self.height), torus=False)
self.grid = OrthogonalVonNeumannGrid((self.width, self.height), torus=False)
# initiate datacollector
self.datacollector = mesa.DataCollector(
model_reporters={
Expand All @@ -95,7 +95,6 @@ def __init__(
max_spice = spice_distribution[cell.coordinate]
Resource(self, max_sugar, max_spice, cell)


for _ in range(self.initial_population):
# get agent position
x = self.random.randrange(self.width)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from mesa.experimental.cell_space import FixedAgent


class Resource(FixedAgent):
"""
Resource:
Expand Down

0 comments on commit 3e54f28

Please sign in to comment.