From 0ebc4d11711eb59480942d24dd13e9a744744704 Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Sun, 18 Aug 2024 10:36:32 +0200 Subject: [PATCH] Add docstring note that Bank is a regular class, not an Agent --- examples/bank_reserves/bank_reserves/agents.py | 6 ++++++ examples/charts/charts/agents.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/examples/bank_reserves/bank_reserves/agents.py b/examples/bank_reserves/bank_reserves/agents.py index 02a4562e..1d561d5b 100644 --- a/examples/bank_reserves/bank_reserves/agents.py +++ b/examples/bank_reserves/bank_reserves/agents.py @@ -14,6 +14,12 @@ 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 + use any Mesa-specific features like the scheduler or the grid, and doesn't + have a step method. It is just used to keep track of the bank's reserves and + the amount it can loan out, for Person agents to interact with.""" + def __init__(self, model, reserve_percent=50): self.model = model # for tracking total value of loans outstanding diff --git a/examples/charts/charts/agents.py b/examples/charts/charts/agents.py index 02a4562e..1d561d5b 100644 --- a/examples/charts/charts/agents.py +++ b/examples/charts/charts/agents.py @@ -14,6 +14,12 @@ 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 + use any Mesa-specific features like the scheduler or the grid, and doesn't + have a step method. It is just used to keep track of the bank's reserves and + the amount it can loan out, for Person agents to interact with.""" + def __init__(self, model, reserve_percent=50): self.model = model # for tracking total value of loans outstanding