Académique Documents
Professionnel Documents
Culture Documents
with MATLAB
Lecture 5 – Agent-based Modeling / Game Theory
Tobias Kuhn and Olivia Woolley
Chair of Sociology, in particular of
Modeling and Simulation
Separation: steer
to avoid crowding
local flockmates
Alignment: steer
towards the average
heading of local
flockmates
Cohesion: steer to
move toward the
average position of local
flockmates
15,15 20,0
0,20 19,19
1,1 0,0
0,0 1,1
Game Examples:
• Stag-hunt
• Assurance game
• Chicken game
• Hawk-dove game
Selection
Replication
Mutation
State update
According to set of
behavioral rules
Time t Time t + dt
Characterized by a state New state
(or states)
(location, dead/alive,
color, level of excitation)
Time line T1 T2
dt
State update
According to set of
behavioral rules,
including neighborhood
Time t Time t + dt
Characterized by a state New state
(location, dead/alive,
level of excitation)
Time line T1 T2
Time loop
Agents loop
- Processing each time steps
% Initial state
State1 = [0 0 0 0];
State2 = [1 1 1 1];
% etc…
% Initial state
State1 = zeros(1,50);
State2 = rand(1,50);
% Time loop
For t=t0:dt:T
end
% Agent loop
For i=1:length(States)
end
% Update
%
% Example: Each agent has 60% chance to
% switch to state 1
randomValue = rand();
% Update
%
% Example: Each agent has chance 'prob' to
% switch to state 1
randomValue = rand();
% Initial state
propAlive = sum(states)/length(states);
>> p=simulation()
p =
0.54
>> p=simulation()
p =
0.72
for n=1:N
p(n)=simulation();
end
>> hist(p)