Secondary Biology 3–4 | Explore how bees respond collectively to windy conditions
💡 Click anywhere on the canvas to label that region.
This simulation implements a Reynolds–Boids agent-based model extended with wind forcing and colony-level clustering, following the formalism used in computational ethology and swarm-intelligence research (Reynolds 1987; Bonabeau, Dorigo & Théraulaz 1999). Each bee \(i \in \{1,\ldots,N\}\) is an autonomous agent with position \(\vec{x}_i \in \mathbb{R}^2\) and velocity \(\vec{v}_i \in \mathbb{R}^2\), updated at each discrete time step \(t\).
Agent positions are advanced by first-order (forward) Euler integration:
The velocity is updated by summing five independent force terms, then clamped to a maximum speed \(v_{max}\):
Each bee perceives conspecifics within a topometric radius \(r_\mathrm{per}\). Two nested neighbourhoods are defined — a separation zone \(r_\mathrm{sep}\) and a larger perception zone \(r_\mathrm{per}\):
Bees steer away from neighbours within the personal-space radius. This prevents physical crushing and maintains airflow — critical for colony thermoregulation:
Bees steer toward the mean normalised heading of their local neighbourhood, producing the coordinated flight patterns seen in swarms:
Each bee is attracted to the centroid of its neighbourhood, scaled by the user-controlled cluster-strength parameter \(\phi_s \in [0,1]\):
A spatially uniform wind of speed \(v_w\) blowing in direction \(\theta_w\) exerts an identical translational impulse on every agent at every step:
where \(\theta_w\) is the compass bearing of the wind direction (e.g.\ \(\theta_w = 270°\) corresponds to wind from the north, pushing bees southward).
Each bee is attracted toward the global colony centroid \(\vec{x}_c\). Crucially, this force grows with both wind speed \(v_w\) and cluster strength \(\phi_s\), modelling the empirically observed transition to tight beard formation in adverse conditions:
The product \(v_w \cdot \phi_s\) ensures that clustering only intensifies when wind is actually present — reflecting the behavioural switch observed in Apis mellifera colonies.
Individual bee flight speed is bounded by \(v_{max}\), preventing numerical blow-up and approximating metabolic constraints:
The activity level \(a_i \in [0,1]\) approximates local bee density and is used to colour-code agents (orange = high activity / warm; teal hollow = peripheral / cool). It serves as a visual proxy for the thermal gradient observed in real beard formations:
\(N_\mathrm{act} = 11\) is a normalisation constant set so that a fully surrounded bee saturates at \(a_i = 1\). The colour mapping is: \(a_i > 0.6\;\Rightarrow\) orange \(\approx\) 35–38 °C (nurse/worker core); \(0.28 < a_i \leq 0.6\;\Rightarrow\) yellow–green (mid zone); \(a_i \leq 0.28\;\Rightarrow\) teal hollow (peripheral guard bees, \(\approx\) 20–25 °C).
The graph plots a real-time compactness metric: the mean distance of all agents from the colony centroid, inverted and normalised to \([0, 100]\%\):
| Parameter | Symbol | Default | Description |
|---|---|---|---|
| Separation strength | \(\alpha_\mathrm{sep}\) | 0.12 | Avoidance force magnitude weight |
| Alignment strength | \(\alpha_\mathrm{ali}\) | 0.03 | Velocity-matching weight |
| Cohesion strength | \(\alpha_\mathrm{coh}\) | 0.04 | Local centering weight |
| Wind coupling coeff. | \(\alpha_w\) | 0.018 | Wind–velocity coupling constant |
| Cluster pull coeff. | \(\alpha_c\) | 0.007 | Colony centroid attraction constant |
| Separation radius | \(r_\mathrm{sep}\) | 22 px | Personal space boundary |
| Perception radius | \(r_\mathrm{per}\) | 65 px | Neighbourhood sensing range |
| Maximum speed | \(v_{max}\) | 2.8 px/step | Speed limiter (locomotion cap) |
| Cluster strength | \(\phi_s\) | [0, 1] | User-controlled cohesion scale |
| Wind speed | \(v_w\) | [0, 10] | User-controlled (m/s, scaled) |
| Wind direction | \(\theta_w\) | 270° | Bearing of wind FROM (degrees) |
| Activity normaliser | \(N_\mathrm{act}\) | 11 | Neighbourhood saturation count |
Answer all 6 questions, then click Submit Quiz to check your answers. Each question connects directly to the equations above — refer back to them if you are unsure!