diff --git a/examples/bank_reserves/bank_reserves/agents.py b/examples/bank_reserves/bank_reserves/agents.py index 6ff9b8a8..02a4562e 100644 --- a/examples/bank_reserves/bank_reserves/agents.py +++ b/examples/bank_reserves/bank_reserves/agents.py @@ -10,15 +10,12 @@ Northwestern University, Evanston, IL. """ -import mesa - from .random_walk import RandomWalker -class Bank(mesa.Agent): - def __init__(self, unique_id, model, reserve_percent=50): - # initialize the parent class with required parameters - super().__init__(unique_id, model) +class Bank: + def __init__(self, model, reserve_percent=50): + self.model = model # for tracking total value of loans outstanding self.bank_loans = 0 """percent of deposits the bank must keep in reserves - this is set via diff --git a/examples/bank_reserves/bank_reserves/model.py b/examples/bank_reserves/bank_reserves/model.py index 6e5fd3ee..f7aab4cb 100644 --- a/examples/bank_reserves/bank_reserves/model.py +++ b/examples/bank_reserves/bank_reserves/model.py @@ -136,7 +136,7 @@ def __init__( ) # create a single bank for the model - self.bank = Bank(1, self, self.reserve_percent) + self.bank = Bank(self, self.reserve_percent) # create people for the model according to number of people set by user for i in range(self.init_people): diff --git a/examples/bank_reserves/batch_run.py b/examples/bank_reserves/batch_run.py index 9562660f..9b06ce3c 100644 --- a/examples/bank_reserves/batch_run.py +++ b/examples/bank_reserves/batch_run.py @@ -148,8 +148,8 @@ def __init__( agent_reporters={"Wealth": "wealth"}, ) - # create a single bank for the model - self.bank = Bank(1, self, self.reserve_percent) + # create a single bank object for the model + self.bank = Bank(self, self.reserve_percent) # create people for the model according to number of people set by user for i in range(self.init_people): diff --git a/examples/charts/charts/agents.py b/examples/charts/charts/agents.py index 6ff9b8a8..02a4562e 100644 --- a/examples/charts/charts/agents.py +++ b/examples/charts/charts/agents.py @@ -10,15 +10,12 @@ Northwestern University, Evanston, IL. """ -import mesa - from .random_walk import RandomWalker -class Bank(mesa.Agent): - def __init__(self, unique_id, model, reserve_percent=50): - # initialize the parent class with required parameters - super().__init__(unique_id, model) +class Bank: + def __init__(self, model, reserve_percent=50): + self.model = model # for tracking total value of loans outstanding self.bank_loans = 0 """percent of deposits the bank must keep in reserves - this is set via diff --git a/examples/charts/charts/model.py b/examples/charts/charts/model.py index 2a739728..616cf8be 100644 --- a/examples/charts/charts/model.py +++ b/examples/charts/charts/model.py @@ -119,7 +119,7 @@ def __init__( ) # create a single bank for the model - self.bank = Bank(1, self, self.reserve_percent) + self.bank = Bank(self, self.reserve_percent) # create people for the model according to number of people set by user for i in range(self.init_people):