From 1b341ad6092a6e411243d89d617e769909f668c4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:02:15 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/bank_reserves/bank_reserves/agents.py | 3 ++- examples/bank_reserves/bank_reserves/model.py | 4 +++- examples/bank_reserves/batch_run.py | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/bank_reserves/bank_reserves/agents.py b/examples/bank_reserves/bank_reserves/agents.py index 34d429cd..b0596a65 100644 --- a/examples/bank_reserves/bank_reserves/agents.py +++ b/examples/bank_reserves/bank_reserves/agents.py @@ -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 @@ -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 diff --git a/examples/bank_reserves/bank_reserves/model.py b/examples/bank_reserves/bank_reserves/model.py index 676003f1..da132f1d 100644 --- a/examples/bank_reserves/bank_reserves/model.py +++ b/examples/bank_reserves/bank_reserves/model.py @@ -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 diff --git a/examples/bank_reserves/batch_run.py b/examples/bank_reserves/batch_run.py index acfb1388..14fe5302 100644 --- a/examples/bank_reserves/batch_run.py +++ b/examples/bank_reserves/batch_run.py @@ -32,6 +32,7 @@ from bank_reserves.model import BankReservesModel + def track_params(model): return (model.init_people, model.rich_threshold, model.reserve_percent) @@ -39,6 +40,7 @@ def track_params(model): def track_run(model): return model.uid + # parameter lists for each parameter to be tested in batch run br_params = { "init_people": [25, 100],