Agent simulations of complex systems: let's learn more about them
FEDORA - Future-oriented Science EDucation to enhance Responsibility and engagement in the society of Acceleration and uncertainty This project received funding from the European Union's Horizon 2020 Research and Innovation program under Grant Agreement n° 872841 www.fedora-project.eu
What words/concepts do you associate with "complexity"?
Complex is not complicated!�Let's look inside the word
Complex, complicated, simple have an Indo-European root in common: -plek
In Latin we have
which resulted in
Nico Vascellari - Nest, 2009 - courtesy Acacia Collection - photo Ela Bialkowska
�
Complex is many things
Complex because it can be studied at multiple levels
In two pictures (and a pun)
I model people's behavior
or
I focus on the agent!
Complex because mathematically
non-linear
Complex because it shows emerging properties
Complex because multi-inter-transdisciplinary
From the lecture of Prof. Bonacorsi
What are we going to do today?
The phenomenon of predation
Predator-prey dynamics (Lotka-Volterra model)
Predator-prey dynamics (Lotka-Volterra model)
x(t) = number of prey at time t
dx(t)/dt = rate of change of the prey population over time
y(t) = number of predators at time t
dy(t)/dt = rate of change of predator population over time t
Coefficients:
a = birth of prey
b = predation
c = birth of predators
d = natural death of predators
Lotka-Volterra: equation-based simulation
Lotka-Volterra: equation-based simulation
From model to reality to case study
From model to reality to case study
What if we want to change our perspective?
Instead of writing with an equation how populations evolve over time, let us imagine that we have many wolves (predators) and many sheep (prey) waiting for precise instructions from us on how to behave.
Let's move on to agent simulation
Task 1) What rules should individual predators and prey follow to give the observed oscillation result?
Different rules for wolves and sheep
Wolf:
Sheep:
Differences between equation-based and agent-based model
Wolf:
Sheep:
x(t) = number of prey at time t
dx(t)/dt = rate of change of the prey population over time
y(t) = number of predators at time t
dy(t)/dt = rate of change of predator population over time t
Coefficients:
a = frequency of prey birth
b = predation frequency
c = birth frequency of predators
d = frequency of natural death of predators
Differences between equation-based and agent-based model
(Each individual) Wolf:
(Every single) Sheep:
x(t) = number of prey at time t
dx(t)/dt = rate of change of the prey population over time
y(t) = number of predators at time t
dy(t)/dt = rate of change of predator population over time t
Coefficients:
a = frequency of prey birth
b = predation frequency
c = birth frequency of predators
d = frequency of natural death of predators
Differences between equation-based and agent-based model
(Each individual) Wolf:
(Every single) Sheep:
x(t) = number of prey at time t
dx(t)/dt = rate of change of the prey population over time
y(t) = number of predators at time t
dy(t)/dt = rate of change of predator population over time t
Coefficients:
a = frequency of prey birth
b = predation frequency
c = birth frequency of predators
d = frequency of natural death of predators
In the equation model, only macroscopic quantities appear, whereas in the agent model we focus on the individual with whom the rules are associated
Differences between equation-based and agent-based model
Wolf:
Sheep:
x(t) = number of prey at time t
dx(t)/dt = rate of change of the prey population over time
y(t) = number of predators at time t
dy(t)/dt = rate of change of predator population over time t
Coefficients:
a = frequency of prey birth
b = predation frequency
c = birth frequency of predators
d = frequency of natural death of predators
Differences between equation-based and agent-based model
Wolf:
Sheep:
x(t) = number of prey at time t
dx(t)/dt = rate of change of the prey population over time
y(t) = number of predators at time t
dy(t)/dt = rate of change of predator population over time t
Coefficients:
a = frequency of prey birth
b = predation frequency
c = birth frequency of predators
d = frequency of natural death of predators
The equation model is deterministic while the agent model is probabilistic
Where do we find these rules in the simulation?
Where do we find these rules in the simulation?
What happens to the system with these rules?
What happens to the system with these rules?
Task 2)
Actually, the behavior observed with simulation is not so absurd...
Laboratory vs. natural environment
A struggle between models
A struggle between models
Differences between equation-based and agent-based model
Wolf:
Sheep:
x(t) = number of prey at time t
dx(t)/dt = rate of change of the prey population over time
y(t) = number of predators at time t
dy(t)/dt = rate of change of predator population over time t
Coefficients:
a = frequency of prey birth
b = predation frequency
c = birth frequency of predators
d = frequency of natural death of predators
The equation model contains a pre-judgment about the system (top-down), while the agent model produces everything from the rules (bottom-up)
Let's try some new rules
Wolf:
Sheep:
Land:
What do we get?
Task 3) Experiment with the same model as above in the second variation and note the main phenomena observed.
A model for changing opinion
Task 4) What do we expect to happen in a �system in which every agent follows �this rule?
Task 5) Experiment with simulation trying to explain why the behaviors you observe at the macroscopic level.
Where do we find the rules in the simulation
Definition of agent
For each agent, we look at the sum of the surrounding agents' opinions and update the variable total
After calculating the sum of neighbors' opinions, the reference agent assumes the opinion of the majority of its neighbors.
The procedure continues until no agent changes his or her opinion any more
What happens with these rules?
Two possible variations
It is possible to modify the basic model with two variations.
By selecting change-vote-if-tied? ON, in case of a 4-4 tie, the reference agent always changes its opinion.
By selecting instead award-close-calls-to-loser? ON, in case of a 5-3 result, the reference agent votes as the minority instead of as the majority.
Stable regions of the same color are formed, but there are fluctuations at the edges
4-4
Parity
FLIP
4-4
Parity
FLIP
4 vs 4 🡪 tie 🡪 change to 0 the opinion of the central agent
0 | 0 | 0 |
0 | 1 | 1 |
1 | 1 | 1 |
0 | 0 | 0 |
0 | 0 | 1 |
1 | 1 | 1 |
4 vs 4 🡪 tie 🡪 change to 1 the opinion of the central agent
Wait a minute,
I had perhaps not signed up
to a class in physics!!!
In physics there is actually a very similar phenomenon...
A model of a magnet
A model of a magnet
Ising's model
Does this remind us of anything?
The emergent property of the system
The power of abstraction
The power of abstraction
"For interdisciplinarity, complex systems are important not only in physics and mathematics but also in epidemics and, I don't know, in the social sphere, and this connects to the third element, which would be the science-society interweaving."
"You can study what behaviors between people are like anyway, run simulations."
A reading on this topic
A model for cooperative behaviors
A model for cooperative behaviors
They eat as much as possible, regardless of the abundance of resources
They only eat if the resources are above a certain threshold (below that threshold, resources take longer to regenerate)
A model for cooperative behaviors
Task 6) What do we expect from a system in which there are only these two types of agents behaving this way?
Only the selfish survive!
Number of agents at the beginning
"Step" of agents in moving
Probability of having cooperative agents (in this case half are cooperative, half are selfish)
Energy lost by agents in reproducing themselves
Energy required for agents to reproduce
Energy lost at each turn (without eating) i
Energy gained from eating
Probability of grass growth when low
Maximum grass height
Threshold between low grass and high grass
Probability of grass growth when high
Different scenarios...
Try some configurations in groups, changing one parameter at a time: what do you get? Why?
An example
By changing the movement the cows can make at each step, it varies the number of iterations required for the greedy population to pass cooperatives
Indeed, they will always find grass to eat, even if they have already eaten what was in the previous position.
In contrast, being able to move only short steps in space makes cooperative behavior more convenient.
Another example
We vary the amount of energy each agent spends to move
With little energy expended with each movement, gluttonous cows easily outperform cooperative ones
If we instead increase the value of the parameter, we arrive at a dynamic equilibrium condition in which the two populations coexist
Concluding
Concluding
The power of interdisciplinarity
"You cannot isolate one subject because you know that anyway all subjects are also interrelated. Then this aspect we can link it to simulations because it still allows us to analyze a situation from multiple points of view."
"Simulations can allow us to see what would happen if we did certain certain actions."
For the next lecture
Continue to experiment with the three simulations seen today, or with NetLogo in general
Start thinking about possible applications of these simple models to real problems in your daily life or in our society
Next time we will start from here!
for your attention