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 Sep 10, 2024
1 parent eeba004 commit 1b341ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/bank_reserves/bank_reserves/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
Center for Connected Learning and Computer-Based Modeling,
Northwestern University, Evanston, IL.
"""

from mesa.spaces import CellAgent


class Bank:
"""Note that the Bank class is not a Mesa Agent, but just a regular Python
class. This is because there is only one bank in this model, and it does not
Expand Down Expand Up @@ -66,7 +68,6 @@ def do_business(self):
if self.savings > 0 or self.wallet > 0 or self.bank.bank_to_loan > 0:
# create list of people at my location (includes self)


# check if other people are at my location
if len(self.cell.agents) > 1:
# set customer to self for while loop condition
Expand Down
4 changes: 3 additions & 1 deletion examples/bank_reserves/bank_reserves/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def __init__(
self.width = width
self.init_people = init_people

self.grid = OrthogonalMooreGrid((self.width, self.height), torus=True, random=self.random)
self.grid = OrthogonalMooreGrid(
(self.width, self.height), torus=True, random=self.random
)
# rich_threshold is the amount of savings a person needs to be considered "rich"
self.rich_threshold = rich_threshold
self.reserve_percent = reserve_percent
Expand Down
2 changes: 2 additions & 0 deletions examples/bank_reserves/batch_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@

from bank_reserves.model import BankReservesModel


def track_params(model):
return (model.init_people, model.rich_threshold, model.reserve_percent)


def track_run(model):
return model.uid


# parameter lists for each parameter to be tested in batch run
br_params = {
"init_people": [25, 100],
Expand Down

0 comments on commit 1b341ad

Please sign in to comment.