Lesson 3 · 15 October 2026
Models, agent-based models and LLMs
How could we find out what saves the lake?
Why do fish stocks collapse, even when no fisher wants them to?
One or two sentences. Use the system, the feedback and the emergence.
In class, you answer here and the answers are grouped into themes.
Would talking save the lake?
Fishers adapt to the lake and to what they hear.
Fishers, a lake and rules for catch and regrowth.
The first version is always wrong, and that's fine.
↓Describe it so that others can judge it.
Many lakes, not one: how often does it survive?
A rule for every fisher, in code or in words.
Railsback & Grimm (2019)
Quick and free.
But we can't follow several loops in our heads.
Finds the loops, like yesterday's diagram.
But it doesn't show what happens over time.
Equations run the loops over time and test rules.
But every fisher is the average fisher.
Real people adapt and talk.
But few rounds, few lakes, only the rules we tried.
Finds patterns in what happened.
But it can't test a rule nobody has tried.
Shows who talks to whom.
But it shows structure, not how the lake changes.
Which one is right depends on the question.
In pairs, 4 minutes.
The largest catch per round that the lake can sustain.
Whether fishers who can agree on rules catch less and earn more.
For each question: name one thing you would include and one you would leave out.
Only the stock and the total catch. Every fisher is the average fisher.
left = stock - catch
stock = min(2 * left, capacity)
Own needs, who talks to whom, what each sees, how each adapts.
for fisher in fishers:
fisher.fish(lake)
What would saving the lake need? Which tools are go-to methods for it?
| Over time | Fishers differ | Fishers adapt | Fisher ↔ lake | Test a rule | Uncertainty | |
|---|---|---|---|---|---|---|
| System dynamics | ● | ● | ||||
| Experiment, like our game | ● | ● | ||||
| Statistics on data | ● | ● | ||||
| Network analysis | ||||||
| Agent-based model | ● | ● | ● | ● | ● | ● |
For rabies in foxes, equations said to vaccinate 70%. An agent-based model found much less is enough, and field studies agree.
Every detail is a choice. Too many details make a model hard to analyse and reproduce.
Fieldwork, theory and equations feed into it.
Biggs et al. (2022) · Railsback & Grimm (2019)
Agents are unique and autonomous, and usually interact locally with each other and their environment.
Fishers differ: debts, boats, trust.
Yesterday: every boat had its own place.
Each decides their own catch, for their own goals.
Yesterday: you chose your own catch.
They deal with neighbours, not with everyone.
Yesterday: a boat saw two spots around it, a starling sees its few neighbours.
They change their catch with the lake and the others.
Yesterday: a boat moved to the most fish.
Railsback & Grimm (2019)
A fisher is a rule for choosing a catch. So far it was code, or it was you.
catch = 3 if lake.stock > 12 else 1
We write the rule, and it does the same every time.
“You are Fisher A. The lake holds at most 24 fish. Every round you choose how many to catch, 0 to 5. […] Your goal: catch as many fish as you can. How many do you catch?”
We write the rule as text. The model reads it every round to choose the catch, and may choose differently each time.
We play yesterday's lake with four of them.
Piatti et al. (2024), GovSim · Park et al. (2023), generative agents
In class, the lake is played live by four fishers that are a language model. You see what they say to each other and why they choose what they choose.
2 of 20 lakes survived
The fishers stay silent.
6 of 20 lakes survived
The setup of our class.
20 of 20 lakes survived
From the very first round.
Our class, with talking from round 4: about half of the lakes collapsed.
Our own runs before class: one model, one prompt, 20 lakes per setup. Not a research result.
An LLM can play a fisher, as here, or read what people say, as it sorted your answers today. Either way it is a model like any other, so the same four questions apply.
What question do these fishers answer, and is a language model the right tool for it?
The prompt gave rules and a goal. Trust, fairness and what a neighbour will do come from the texts the model learned from.
Ours mostly kept to their plan in the last round. Do real fishers? What would we compare with?
The same prompts gave different lakes. Would a second model, or someone else, get our numbers?
Runs the lake model. uv installs Python and packages.
Where you write the model, with git and Copilot.
Saves every version of your model.
Shares the model with your team. You hand in here.
AI help in VS Code, free with GitHub Education.
We use Python 3.12+, installed and managed by uv.
Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv add package-name # install a package
uv run script.py # run a script
uv --version in a terminal.
Download: code.visualstudio.com
Windows: the User Installer (64-bit). macOS: the Universal build.
Then install the Python extension by Microsoft. VS Code suggests it when you open a .py file.
Windows: git-scm.com, the default settings are fine.
macOS: already installed, or installed on first use.
Check: git --version in a terminal.
Add your university e-mail to your account, then apply for the Student Developer Pack. Approval can take a few days.
Sign in to VS Code with your GitHub account. Free for verified students, with monthly limits.
Work on your own laptop. Ask when something doesn't work.
Installed. This prints a version:
uv --version
Open a folder, add hello.py with a print line, run it in the terminal:
uv run hello.py
Installed. This prints a version:
git --version
You can log in, and the Education application is sent.
x = 5
y = x
x = x + 1
print(x, y) # 6 5
y = x
gives the same value a second label. x = x + 1
moves the label x
to a new value. y
keeps the old one.
speed = 3
if speed > 5:
print("fast")
else:
print("slow") # slow
The block under if
runs when the condition is true, otherwise the else
block.
catches = [3, 1, 2]
print(catches[0]) # 3, counting starts at 0
print(len(catches)) # 3, how many items
catches.append(4)
print(catches) # [3, 1, 2, 4]
Square brackets, items in order. append adds one at the end.
catches = [3, 1, 2]
for catch in catches:
print(catch) # 3, 1, 2
In each pass, catch
is a variable for the next item. The loop body works with that variable.
Railsback, S. F. & Grimm, V. (2019). Agent-Based and Individual-Based Modeling: A Practical Introduction. 2nd ed.
Biggs, R. et al. (eds., 2022). The Routledge Handbook of Research Methods for Social-Ecological Systems.
Piatti, G. et al. (2024). Cooperate or collapse: emergence of sustainable cooperation in a society of LLM agents.
Park, J. S. et al. (2023). Generative agents: interactive simulacra of human behavior.
Also: Jackson (2024) · Hardin (1968) · Ostrom (1990) · Forrester (1994)