2 ABM Slides
2 ABM Slides
virtual world
For an ABM to also be good science and give us meaningful conclusions, we need to wrap the technical
aspects of its design up with proper methodology and ensure we are considering the:
Sayama says that: "Meaningful conclusions" implies there are implications for the real-world system
being modeled:
Building an ABM using assumptions derived from empirically observed phenomena, and then
produce previously unknown collective behaviours
Building an ABM using hypothetical model assumptions, and reproducing empirically observed
collective phenomena
I agree.
But Sayama also says that: analysis is "generally not easy to conduct an elegant mathematical analysis of
an ABM", which is why there is no “Analysis” chapter on ABMs in his textbook. I disagree. I think
'meaningful conclusions' requires a proper analysis
VICSEK MODEL
This model was introduced by Tamás Vicsek (and colleagues not fortunate enough have the model
named after them) in 1995 to simulate the collective motion of self-propelled particles
Vicsek's particles adjusted their velocities to align with the average velocities of the neighbouring agents
That's it. Nothing more, nothing less. And it is exactly this minimal nature that gives us a chance of
mathematical analysis
Our understanding of emergent phenomena such as phase transitions and criticality, and the quest for
universal laws and patterns of collective behaviour has gained enormous benefit from the study of simple
models like this
This model plays a prototypical role, similar to the one played by the Ising model for equilibrium
ferromagnetism and has been adopted as the starting point for many generalisations and variations.
ISING MODEL
Ising model of ferromagnetism in statistical mechanics
The model consists of discrete variables that represent magnetic dipole moments of atomic "spins" that
can be in one of two states (+1 or -1) i.e. 1D
Neighbouring spins that agree have a lower energy than those that disagree; the system tends to the
lowest energy but heat disturbs this tendency, thus creating the possibility of different structural phases
The model allows the identification of phase transitions as a simplified model of reality
XY MODEL
XY is a generalisation of the Ising model with the dipole able to have any state i.e. 2D
Magnetic dipoles that rotate and align with the magnetic field of their surrounding
https://www.complexity-explorables.org/explorables/if-you-ask-your-xy/
Inspired by this, Vicsek and his team began to think about what it would mean for the spins in a
ferromagnet to have the freedom to move
(The Heisenberg Model is a more general model of three-component spins (i.e. 3D), so technically Vicsek
had designed the moving version of the XY model).
MODEL SPECIFICS
the world and environment: 2D square domain with periodic boundaries, the environment has no
state.
the agents: N point particles
the possible states (or attributes): position and velocity (direction)
the initial state: random
the interaction network: metric with maximum distance r
the rules for updating the agent state: assume average direction of neighbours + some noise,
synchronous updates for all agents at each time step. Note this describes "overdamped
dynamics" as the inertial effects are negligible, and the motion of the agents is primarily
determined by the forces acting on them (change their relative position according to their velocity
fluctuations), rather than by their own momentum. The system is far from equilibrium because the
particles are self-propelled.
MODELLING STEPS
1. initialise a domain (square domain with periodic boundaries, agent.velocity is a random direction
with constant speed, agent.position is random inside of domain)
2. initialise N agents and their attributes:
position: A tuple representing the x and y coordinates of the agent.
velocity: A tuple representing the agent's current velocity, v defined by the heading θ
and a constant, speed.
3. determine each agents' neighbours (defined as those inside of a circle of radius, r, centred at the
agent)
4. average the velocities of each agents' neighbours (including self in neighbourhood)
5. update agent attributes:
θ(t + 1) = ⟨θ(t)⟩r + Δθ
x(t + 1) = x(t) + v(t)Δt
Δθ is a random number chosen with a uniform probability from the interval [−η/2, η/2].
NOISE
The role of randomness in models of complex systems:
Scalar/Intrinsic noise: agent makes "mistake" when moving in the (perfectly determined)
direction
θ(t + 1) = ⟨θ(t)⟩r + Δθ
Vectorial/Extrinsic noise: errors/uncertainties in the particle-particle communication
mechanism/assessment of neighbour directions
θ(t + 1) = ⟨θ(t) + Δθ⟩r
The Vicsek model is robust to the source of noise provided that no long-range correlations are
introduced.
LIMITING CASES
Limiting cases are often interesting and worth exploring as the model reduces to well-known models of
equilibrium statistical physics
e.g. in the limit, v → 0, the interaction network is fixed and the individuals are just selecting a new
direction without moving at each time step. The model reduces precisely to that of a two-dimensional XY
model. We interpret he velocity of the individual as the local spin, the strength of the alignment
interaction is proportional to the density like an external magnetic field and the noise is like temperature
It is not possible in general to deduce properties of the Vicsek model in general from the study of the
limiting cases.
QUALITATIVE ANALYSIS
The first thing we did with our model is to simulate it and play around, observing how the agents move
over time and the group behaviour that emerges
This gives us a qualitative understanding of the behaviour of the collective and how it depends on the
parameter settings for L (which is effectively density) and η (the amount of stochasticity)
The simulations are nice for our understanding but they are typically relegated to supplementary material
in publications in favour of snapshots in time or trajectories:
Again, we are seeing simple interactions among individuals leading to complex global patterns
QUANTITATIVE ANALYSIS
We seek a generalisable and statistically reliable description of observations via appropriate metrics at
the individual or group level
Flocking models lean heavily on methods and measures successfully used in statistical physics
Order parameters characterise how ordered the macroscopic state of the system is
In keeping with the spin-model analogy, the Vicsek model used the average normalised velocity as a
polarisation order parameter, va :
1 ∣ N ∣
va = ∣ ∑ v→i ∣
Nv ∣ i ∣
This is a value that ranges from 0 to 1, where 0 indicates no order and 1 indicates maximal order and
coherent motion (this is why we can refer to it as an order parameter)
density via the size of the domain, L, with fixed particle number
noise, η
There are other parameters in this model, such as the speed v but 'According to our simulations, in a
wide range of the velocities (0.003 < v < 0.3), the actual value of v does not affect the results' -
Vicsek et. al [1995]
Here, 'the results' refers to the physical properties of the emergent behaviour
We'd like a more general understanding of how these parameters influence the behaviour. In particular,
we want answers to:
PARAMETER SWEEPS
The phase transitions are bifurcations in the macroscopic properties, captured by changes in the relevant
state variables
For Vicsek, that means we compute the polarisation order parameter for each simulation as we vary the
noise and/or density
It's akin to a transition from solid to liquid to gas as temperature and pressure are varied.
ENSEMBLE RUNS
To properly demonstrate phase transitions we must show that they occur in general, because a single
simulation doesn't tell you much (and may even be misleading)
Monte Carlo are a broad class of computational algorithms that rely on repeated random sampling to
obtain numerical results that statistical measures can be calculated from
The original paper runs five simulations at each parameter setting and states that the error bars are
generally within the size of the symbol. If this wasn't the case you'd need to show the variation.
Here Couzin computes two different order parameters (polarisation and rotation) and shows the mean of
30 replicates:
If you aren't re-initialising when starting a new simulation then interesting things can happen
capture the range of possible outcomes owing to variability (inherent randomness, stochastic
processes, or sensitivity to initial conditions)
explore effects of uncertainty, providing a distribution of possible outcomes
reduce noisy or outlier results and identify (and estimate probability of) rare events
give a better understanding of parameter sensitivities
highlight emergent behaviour as consistent patterns or structures that emerge across different
simulations
validate the robustness of model predictions.
The basic rules of interaction assumed by Reynolds, Couzin etc were just educated guesses as opposed
to well-established scientific fact
Empirical insight came from Cavagna and Gardina's work as part of STARFLAG
STARFLAG used stereoscopy (two simultaneous images of the same object taken from different positions
in space to reconstruc the exact 3D position of an object. Our eyes and brain use it to estimate distances
and give sense of 3D)
Correspondence problem: We need to match the individuals in the two images but due to the different
positions of the left and right cameras (25 metres apart and ~100 metres from the birds), the flock can
look very different
This allowed a comparison of models on a quantitative basis to real flocks, whereas previously we could
only assess similarity qualitatively.
TO SUMMARISE...
An agent-based simulation is interesting but not scientific
1. quantify the observed behaviour (at the macro and maybe also the micro-levels) with something
like an order parameter
2. demonstrate how the behaviour depends on parameters with
parameter sweeps
ensemble runs to report statistics