Graphing and start of CA
REFER TO SLIDES
Game of Life Explanation
Schellings Model - Model of Segregation Explanation
When quantified as a graph, what does schellings model show?
The y-axis (Segregation) shows how clustered the agents are — specifically, the average fraction of each agent’s neighbours who are the same type (or “colour”) as that agent.
- A value of 1.0 means perfect segregation: everyone’s neighbours are the same type.
- A value of 0.5 would mean a completely mixed neighbourhood (roughly half same-type, half other).
- The x-axis (Time steps) shows how the system evolves over time as unhappy agents move.
===
Each line corresponds to a different tolerance threshold (p) — the minimum fraction of same-type neighbours needed for an agent to feel happy.
For example:
- p = 0.3: agents are tolerant; they’re fine even if only 30% of neighbours are the same.
- p = 0.5 or 0.7: agents are less tolerant; they need more same-type neighbours to be happy.
How can you add randomness to the schelling model
Besides the initial randomness that comes with model, that being random distribution of housing and empty spaces, we can also have randomly chosing of empty spaces, and agents being updated randomly as well rather than in order
SugarScape Model Explanation
The Sugarscape World (environment):
- Each cell in the 2D grid has a capacity (maximum amount of sugar it can hold).
- There are two high-sugar regions, with capacity 4 (peaks), surrounded by concentric rings with capacities 3, 2, and 1.
The Agents:
- 400 agents are placed at random locations. Each agent has their randomly-chosen attributes:
- Sugar: how much sugar they start with;
- Metabolism: how much sugar they consume per time step;
- Vision: how far they can see (radius of k).
During each time step, agents move one at a time in a random order. Each agent follows these rules:
- The agent surveys k cells in each of the 4 compass directions, where k is the range of the agent’s vision.
- It chooses the unoccupied cell with the most sugar. In case of a tie, it chooses the closer cell; among cells at the same distance, it chooses randomly.
- The agent moves to the selected cell and harvests the sugar, adding the harvest to its accumulated wealth and leaving the cell empty.
- The agent consumes some part of its wealth, depending on its metabolism. If the resulting total is negative, the agent “starves” and is removed.
World (environment) update rules:
- After all agents have executed these steps, the cells grow back some sugar, typically 1 unit, but the total sugar in each cell is bounded by its capacity.
When quantified as a graph, what does SugarScape model show?
What the graph shows
- Y-axis: Number of agents still alive.
- X-axis: Simulation time steps.
- The curve drops over time, meaning agents are gradually dying off (starving).
===
At the start, 400 agents are placed randomly across the landscape.
- Agents in low-sugar regions or with high metabolism and low vision can’t find enough sugar to survive.
- They consume sugar faster than they collect it, so their sugar store drops below zero → they die.
As time goes on:
- The number of living agents declines until the population stabilizes at a smaller number that the environment can sustain.
- Agents with better vision or who were lucky to start near sugar peaks tend to survive longer.
===
Why the population stabilizes
- Sugar grows back slowly (1 unit per step) and has a maximum capacity in each cell.
- This limits the total available sugar in the environment.
- Once a sustainable balance is reached between sugar production and agent consumption, the population levels off — the remaining agents can gather enough sugar to survive.
What other factors could be included in the SugarScape model?
Agent’s age can increase at each time step
Agents have finite lifespan
New agent can be added to the environment if an existing agent died, to make the population unchanged.
When quantified as a graph, what does SugarScape model show when we give the agents infinite lifespans?
What the graph represents
- X-axis: Wealth (the amount of sugar an agent has).
- Y-axis: Cumulative Distribution Function (CDF) of wealth.
- The CDF shows the proportion of agents whose wealth is less than or equal to a given amount.
===
When agents have finite lifespans (they die after a certain age) and new agents are added, the system reaches a stationary wealth distribution — meaning the overall shape of the wealth distribution becomes stable over time, even though individual agents come and go.
- Some agents accumulate high wealth because they start in good locations (near sugar peaks) or have low metabolism and high vision.
- Most agents have low to moderate wealth, reflected by the steep initial rise in the CDF.
-A smaller number of agents become very rich, causing the tail of the curve to flatten out near the top.
How can you add/see randomness in the sugarscape model?
Random initial placements of agents
Random agent attributes
Random movement tie breaking: when multiple unoccupied cells have the same maximum sugar level, the agent then randomly chooses one
Traffic Jam Model Explanation
When quantifing driver behaviour as a graph, what does traffic jam model show?
What the graph represents
- X-axis: Number of cars on the highway (traffic density).
- Y-axis: Average speed of all cars.
- Lines: Different levels of driver “noise” (eps), which introduces randomness into how each car accelerates or reacts.
===
What the results show
As the number of cars increases, the average speed decreases sharply.
- With few cars, everyone can travel near the speed limit.
- As traffic becomes dense, spacing shrinks, so cars slow down to avoid crashes.
Higher noise values (larger eps) lead to lower overall average speeds.
- Noise represents variability or unpredictability in driver behavior.
- When drivers react inconsistently, stop-and-go waves and mini-jams appear more often, reducing average speed even further.
How is randomness showning the traffic jam model
Cars are often randomly distributed around the circular track.
Each car may start with a random initial speed within allowed limits.
You can add randomly chosen acceleration rates and slow down rates, and alter update order
REFER TO SLIDES FOR CODE
Boids Model Explanation
How is randomness and emergance seen in boids?
Random is inherently random in bird placement, that allows for the emergance of flocking
You can add other forms of randomness such as having different weights for the attributes or adding jitter, can also update movement randomly
Basic Machinery for Modelling Evolution
How to represent the genotype?
○ A vector of numbers of zeros and ones for example
How to setup the fitness value? How to relate it to different genotypes?
Which agents will die over generations? How to choose them?
How many agents will be reproduced? Which agents will be reproduced?
○ Close proximity
○ Sexual or asexual, etc
Evolution Model Explanation - Fitness landscape
Evolution of Cooperation - Prisoners Dilemma
Percolation (site percolation with wetting) Model
Notes: Estimate the percolation probability by repeating steps 1–4 many times and counting successes.
Sandpile Model