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 c433382 commit 40399c7
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
4 changes: 3 additions & 1 deletion examples/bank_reserves/bank_reserves/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def __init__(self, model, moore, bank, rich_threshold):
def do_business(self):
"""check if person has any savings, any money in wallet, or if the
bank can loan them any money"""
if (self.savings > 0 or self.wallet > 0 or self.bank.bank_to_loan > 0) and len(self.cell.agents) > 1:
if (self.savings > 0 or self.wallet > 0 or self.bank.bank_to_loan > 0) and len(
self.cell.agents
) > 1:
# create list of people at my location (includes self)
# set customer to self for while loop condition
customer = self
Expand Down
1 change: 1 addition & 0 deletions examples/bank_reserves/batch_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
directory from which Python was run. The CSV file will contain the data from
every step of every run.
"""

import itertools
import mesa
import pandas as pd
Expand Down
1 change: 0 additions & 1 deletion examples/hex_snowflake/hex_snowflake/cell.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from mesa.experimental.cell_space import FixedAgent


Expand Down
3 changes: 1 addition & 2 deletions examples/pd_grid/pd_grid/agent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from mesa.experimental.cell_space import CellAgent


Expand Down Expand Up @@ -31,7 +30,7 @@ def step(self):
if better than own score."""

# neighbors = self.model.grid.get_neighbors(self.pos, True, include_center=True)
neighbors = [*list(self.cell.neighborhood.agents), self]
neighbors = [*list(self.cell.neighborhood.agents), self]
best_neighbor = max(neighbors, key=lambda a: a.score)
self.next_move = best_neighbor.move

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from mesa.experimental.cell_space import FixedAgent


Expand Down
1 change: 0 additions & 1 deletion examples/wolf_sheep/wolf_sheep/agents.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from mesa.experimental.cell_space import CellAgent, FixedAgent


Expand Down

0 comments on commit 40399c7

Please sign in to comment.