Collective Behaviour

Basic interactions like repulsion, orientation and attraction can operate to different extents and give rise to a variety of dynamical behaviours.

This real-time simulation is computationally complex and may induce unresponsiveness on lower-end devices



Group angular momentum:





Interactions

All boids (a generic term used to indicate agents in collective behaviour) interact with each other via three interactions:

  1. Repulsion:
    When boids come too close, they move away from each other. Suppose there are \(n_r\) boids within the repulsion radius of a particular boid \(i\). If \(\vec{d}\) represents their direction, and \(\vec{c}\) represents their position, then repulsion dictates: \[ \vec{d}_{i, r} (t + \tau) = - \sum_{j \not = i}^{n_r} \frac{\vec{c}_j (t) - \vec{c}_i (t)}{|\vec{c}_j (t) - \vec{c}_i (t)|} \]
  2. Orientation:
    Boids tend to orient themselves along the direction of their neighbours. Suppose there are \(n_o\) boids within the orientation radius of a particular boid \(i\). If \(\vec{v}\) represents their velocity, then orientation dictates: \[ \vec{d}_{i, o} (t + \tau) = \sum_{j = 1}^{n_o} \frac{\vec{v_j} (t)}{|\vec{v_j} (t) |}\]
  3. Attraction:
    Boids tend to move towards the centre of mass of their neighbours. Suppose there are \(n_a\) boids within the attraction radius of a particular boid \(i\). then attraction operates exactly opposite to orientation: \[ \vec{d}_{i, a} (t + \tau) = \sum_{j = 1}^{n_r} \frac{\vec{c}_j (t) - \vec{c}_i (t)}{|\vec{c}_j (t) - \vec{c}_i (t)|} \]

If there are any boids in the repulsion zone of a boid, then the boid only follows the repulsion rule. If there are boids that lie in the attraction as well as the orientation zone, then the boid averages the result of both interactions. The boids can turn only at a limited angle \( \theta \) in every time step. Further, there is a blind angle \( \alpha \) behind each boid where it cannot perceive other boids. Every boid moves with the same velocity \(v\) along its current direction. The intended direction of every boid is perturbed by random noise. This represents errors in judgement made by the boids.


Metrics

The following quantities can be used to quantify the collective motion of boids:

  1. Group polarization:
    This quantifies the degree of overall alignment of the boids. If every boid is moving along the same direction, then group polarization is 1. If all boids are moving along random directions, then group polarization is 0. \[ p (t) = \frac{1}{N} \left| \sum_{i}^{N} \vec{v}_i (t) \right| \]
  2. Group angular momentum:
    Measures the degree of rotation of the group along their center: \[ m (t) = \frac{1}{N} \left| \sum_{i}^{N} \vec{r}_{ic} (t) \times \vec{v}_i (t) \right| \] Here, \( \vec{r}_{ic} = \vec{c}_i - \vec{c}_{group} \) is the displacement vector of the \(i^{th}\) boid from the center of mass of the group, which is given by: \[ \vec{c}_{group} (t) = \sum_{i = 1}^{N} \vec{c}_{i} (t) \]

Dynamical Behaviours

Depending on the strengths of various interactions, as well as other parameters, the boids can exhibit four different kinds of dynamical behaviour:

  1. Swarming:
    Characterised by low polarization and low angular momentum
    This behaviour is seen when attraction is the dominant force, and there is negligible orientation. Boids rotate in random directions, repeatedly flying into the center of the group and then emerging out. This sort of behaviour is often seen in insects.


  2. Swirling:
    Characterised by low polarization and high angular momentum
    This behaviour is observed when orientation is low whereas attraction is relatively high. Boids revolve around a common point in the same direction. This behaviour is seen in fish.
    It may take some time for swirls to emerge.


  3. Dynamic parallel grouping:
    Characterised by high polarisation and low angular momentum
    This behaviour is observed when orientation is intermediate whereas attraction can be either intermediate or relatively high. Boids move in groups called 'flocks'. Seen in birds and fish.


  4. Highly parallel grouping:
    Characterised by very high polarisation and low angular momentum
    This behaviour is seen when orientation is high.
    It may take some time for highly parallel groupings to emerge.




Note:
  1. This model is from the paper "Collective Memory and Spatial Sorting in Animal Groups" by Couzin et al. https://doi.org/10.1006/jtbi.2002.3065
  2. If reflect is off, boids just teleport from one edge to another. Implementing a periodic boundary condition was not possible owing to the complex nature of this simulation
  3. Although this simulation is usable on a mobile, it is preferably viewed on a desktop.
  4. Related: Firefly Synchronization, Vicsek Model, Pedestrian Dynamics.

Developed by ChanRT | Fork me at GitHub