Agent Based Modeling: Difference between revisions
BloomWiki: Agent Based Modeling |
BloomWiki: Agent Based Modeling |
||
| Line 1: | Line 1: | ||
<div style="background-color: #4B0082; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | |||
{{BloomIntro}} | {{BloomIntro}} | ||
Agent-Based Modeling (ABM) is a powerful computational technique for studying complex systems by simulating the actions and interactions of autonomous individuals (called '''Agents'''). It is a "Bottom-Up" way of doing science. Instead of using a single equation to predict how a whole population will act, we create thousands of "Digital People," give them simple rules, and watch what happens when they interact. ABM allows us to see how a small change in individual behavior can lead to massive "Emergent" shifts in a city, a market, or an ecosystem. It is the closest thing science has to a "Virtual Laboratory." | Agent-Based Modeling (ABM) is a powerful computational technique for studying complex systems by simulating the actions and interactions of autonomous individuals (called '''Agents'''). It is a "Bottom-Up" way of doing science. Instead of using a single equation to predict how a whole population will act, we create thousands of "Digital People," give them simple rules, and watch what happens when they interact. ABM allows us to see how a small change in individual behavior can lead to massive "Emergent" shifts in a city, a market, or an ecosystem. It is the closest thing science has to a "Virtual Laboratory." | ||
</div> | |||
== Remembering == | __TOC__ | ||
<div style="background-color: #000080; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | |||
== <span style="color: #FFFFFF;">Remembering</span> == | |||
* '''Agent-Based Modeling (ABM)''' — A simulation technique used to understand the behavior of a system by modeling its individual parts. | * '''Agent-Based Modeling (ABM)''' — A simulation technique used to understand the behavior of a system by modeling its individual parts. | ||
* '''Agent''' — An autonomous entity in a simulation that follows a set of rules (e.g., a Person, a Car, a Bird). | * '''Agent''' — An autonomous entity in a simulation that follows a set of rules (e.g., a Person, a Car, a Bird). | ||
| Line 15: | Line 20: | ||
* '''NetLogo''' — The most popular programming language and platform for building agent-based models. | * '''NetLogo''' — The most popular programming language and platform for building agent-based models. | ||
* '''Sensitivity Analysis''' — Testing how much the final result changes when you slightly change one individual rule. | * '''Sensitivity Analysis''' — Testing how much the final result changes when you slightly change one individual rule. | ||
</div> | |||
== Understanding == | <div style="background-color: #006400; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Understanding</span> == | |||
ABM is understood through '''Rules''' and '''Aggregation'''. | ABM is understood through '''Rules''' and '''Aggregation'''. | ||
| Line 35: | Line 42: | ||
'''The Schelling Model of Segregation''': This is the most famous ABM. Thomas Schelling showed that even if every person is "tolerant" (meaning they are happy as long as 30% of their neighbors are like them), the entire city will still end up 100% segregated. This proved that "Individual Intent" is not the same as "Group Outcome." | '''The Schelling Model of Segregation''': This is the most famous ABM. Thomas Schelling showed that even if every person is "tolerant" (meaning they are happy as long as 30% of their neighbors are like them), the entire city will still end up 100% segregated. This proved that "Individual Intent" is not the same as "Group Outcome." | ||
</div> | |||
== Applying == | <div style="background-color: #8B0000; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Applying</span> == | |||
'''Modeling 'The Forest Fire' (A Cellular Automaton):''' | '''Modeling 'The Forest Fire' (A Cellular Automaton):''' | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
| Line 81: | Line 90: | ||
: '''Epidemiological Models (COVID)''' → Using ABM to simulate every individual in a city to see how "closing schools" vs "wearing masks" affects the hospitals. | : '''Epidemiological Models (COVID)''' → Using ABM to simulate every individual in a city to see how "closing schools" vs "wearing masks" affects the hospitals. | ||
: '''Financial Market Simulators''' → Trading bots competing against each other to see how "Flash Crashes" happen. | : '''Financial Market Simulators''' → Trading bots competing against each other to see how "Flash Crashes" happen. | ||
</div> | |||
== Analyzing == | <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Analyzing</span> == | |||
{| class="wikitable" | {| class="wikitable" | ||
|+ Equation-Based vs. Agent-Based | |+ Equation-Based vs. Agent-Based | ||
| Line 102: | Line 113: | ||
* '''Validation''': "Did I build the right model?" (Does it actually look like a real city?). | * '''Validation''': "Did I build the right model?" (Does it actually look like a real city?). | ||
Analyzing the "Truthfulness" of a simulation is the most difficult part of ABM. | Analyzing the "Truthfulness" of a simulation is the most difficult part of ABM. | ||
</div> | |||
== Evaluating == | <div style="background-color: #483D8B; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Evaluating</span> == | |||
Evaluating an ABM: | Evaluating an ABM: | ||
# '''Stochasticity''': If you run the model 10 times, do you get 10 completely different answers (too much randomness)? | # '''Stochasticity''': If you run the model 10 times, do you get 10 completely different answers (too much randomness)? | ||
| Line 109: | Line 122: | ||
# '''Scaling''': Does the model still work when you go from 100 agents to 1,000,000? | # '''Scaling''': Does the model still work when you go from 100 agents to 1,000,000? | ||
# '''Equifinality''': Is there more than one way the model could have produced the result? | # '''Equifinality''': Is there more than one way the model could have produced the result? | ||
</div> | |||
== Creating == | <div style="background-color: #2F4F4F; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> | ||
== <span style="color: #FFFFFF;">Creating</span> == | |||
Future Frontiers: | Future Frontiers: | ||
# '''Digital Twins''': Creating a perfect ABM of a real-world city (like Singapore) to test every new law or bridge before it is built. | # '''Digital Twins''': Creating a perfect ABM of a real-world city (like Singapore) to test every new law or bridge before it is built. | ||
| Line 120: | Line 135: | ||
[[Category:Computer Science]] | [[Category:Computer Science]] | ||
[[Category:Sociology]] | [[Category:Sociology]] | ||
</div> | |||
Latest revision as of 01:46, 25 April 2026
How to read this page: This article maps the topic from beginner to expert across six levels � Remembering, Understanding, Applying, Analyzing, Evaluating, and Creating. Scan the headings to see the full scope, then read from wherever your knowledge starts to feel uncertain. Learn more about how BloomWiki works ?
Agent-Based Modeling (ABM) is a powerful computational technique for studying complex systems by simulating the actions and interactions of autonomous individuals (called Agents). It is a "Bottom-Up" way of doing science. Instead of using a single equation to predict how a whole population will act, we create thousands of "Digital People," give them simple rules, and watch what happens when they interact. ABM allows us to see how a small change in individual behavior can lead to massive "Emergent" shifts in a city, a market, or an ecosystem. It is the closest thing science has to a "Virtual Laboratory."
Remembering[edit]
- Agent-Based Modeling (ABM) — A simulation technique used to understand the behavior of a system by modeling its individual parts.
- Agent — An autonomous entity in a simulation that follows a set of rules (e.g., a Person, a Car, a Bird).
- Emergence — When a complex global behavior arises out of simple local rules (The "Magic" of ABM).
- Environment — The virtual space in which agents move and interact (e.g., a Grid, a Network, or a Map).
- Bounded Rationality — The idea that agents only have limited information and limited brainpower (unlike the "perfect" individuals in classical economics).
- Local Interaction — Agents only react to things immediately around them, not the whole system.
- Stochasticity — The use of "Randomness" in a model to represent the unpredictability of the real world.
- Monte Carlo Simulation — Running the same model thousands of times with different random seeds to see the average outcome.
- Validation — The process of ensuring that the model's output matches real-world data.
- Emergent Property — A macro-level pattern that was not explicitly programmed (e.g., a traffic jam).
- NetLogo — The most popular programming language and platform for building agent-based models.
- Sensitivity Analysis — Testing how much the final result changes when you slightly change one individual rule.
Understanding[edit]
ABM is understood through Rules and Aggregation.
1. The 'Three-Step' Loop: Every agent in every simulation follows a loop:
- Observe: What is happening around me? (e.g., "Is there a predator nearby?")
- Decide: Based on my rules, what should I do? (e.g., "If yes, run away.")
- Act: Change the state or position. (e.g., "Move to coordinate X,Y.")
2. Complexity from Simplicity: The power of ABM is that the rules can be very dumb, but the result is very smart.
- The Boids Model: To simulate a flock of birds, you don't need a "Leader." You just give every bird three rules: "Don't hit others," "Stay near the group," and "Fly in the same direction."
- Result: Perfectly realistic, "swarming" behavior.
3. Discovering 'Tipping Points': ABM is excellent for finding "The Point of No Return."
- If 10% of people wear masks, the virus spreads. If 15% wear them, nothing changes. But if 20% wear them, the virus suddenly dies out. ABM helps us find that "Magic Number" (the Phase Transition).
The Schelling Model of Segregation: This is the most famous ABM. Thomas Schelling showed that even if every person is "tolerant" (meaning they are happy as long as 30% of their neighbors are like them), the entire city will still end up 100% segregated. This proved that "Individual Intent" is not the same as "Group Outcome."
Applying[edit]
Modeling 'The Forest Fire' (A Cellular Automaton): <syntaxhighlight lang="python"> import random
def simulate_fire(grid_size, density):
"""
Agents: Trees. Rule: 'If neighbor is on fire, I catch fire.'
"""
# Create a grid of trees (1) or empty (0)
grid = [[1 if random.random() < density else 0 for _ in range(grid_size)]
for _ in range(grid_size)]
# Start a fire at the top row
fire = [(0, i) for i in range(grid_size) if grid[0][i] == 1]
burnt_count = len(fire)
# Simple 'Spread' logic
while fire:
x, y = fire.pop(0)
grid[x][y] = 2 # Burnt
# Check 4 neighbors
for dx, dy in [(0,1), (0,-1), (1,0), (-1,0)]:
nx, ny = x+dx, y+dy
if 0 <= nx < grid_size and 0 <= ny < grid_size:
if grid[nx][ny] == 1:
grid[nx][ny] = 2
fire.append((nx, ny))
burnt_count += 1
return burnt_count / (grid_size * grid_size)
- Low Density: 40% trees
print(f"Burnt area at 40%: {simulate_fire(20, 0.40) * 100:.1f}%")
- High Density: 70% trees
print(f"Burnt area at 70%: {simulate_fire(20, 0.70) * 100:.1f}%")
- Note: The fire doesn't just grow linearly; it 'explodes'
- once the density hits a critical point (~59%).
</syntaxhighlight>
- ABM Landmarks
- Conway's Game of Life → A 0-player game where 4 simple rules create infinite patterns, gliders, and even "computers" made of cells.
- Sugarscape → A simulation that proved how inequality and wealth gaps emerge naturally even when everyone starts with the same ability.
- Epidemiological Models (COVID) → Using ABM to simulate every individual in a city to see how "closing schools" vs "wearing masks" affects the hospitals.
- Financial Market Simulators → Trading bots competing against each other to see how "Flash Crashes" happen.
Analyzing[edit]
| Feature | Equation-Based (Physics/Calc) | Agent-Based (ABM) |
|---|---|---|
| Level | Top-Down (The whole group) | Bottom-Up (The individual) |
| Variation | Everyone is 'Average' | Everyone is 'Unique' |
| Interaction | Aggregate (Mean-Field) | Direct and Local |
| Strength | Very fast / Mathematically pure | Can find 'Surprising' emergence |
| Analogy | A 'Formula' | A 'Video Game' |
The Concept of "Verification vs. Validation":
- Verification: "Did I build the model right?" (Is the code bug-free?).
- Validation: "Did I build the right model?" (Does it actually look like a real city?).
Analyzing the "Truthfulness" of a simulation is the most difficult part of ABM.
Evaluating[edit]
Evaluating an ABM:
- Stochasticity: If you run the model 10 times, do you get 10 completely different answers (too much randomness)?
- Rule Simplicity: Are the rules based on real psychology or just "guesses"?
- Scaling: Does the model still work when you go from 100 agents to 1,000,000?
- Equifinality: Is there more than one way the model could have produced the result?
Creating[edit]
Future Frontiers:
- Digital Twins: Creating a perfect ABM of a real-world city (like Singapore) to test every new law or bridge before it is built.
- Social Media Simulation: Using 100 million "Bot Agents" to see how fake news spreads and how to stop it.
- AI-Agents: Replacing simple "If/Then" rules with "Large Language Models" so the agents can actually "talk" and "reason" with each other.
- Multi-Scale ABM: Modeling a whole country by linking models of cells, people, and weather into one giant system.