Speed-Weighted Adaptive Flocking for Sailing Swarms under Dynamic Environmental Forcing
Supplementary Material for SAB 2026
Pranav Kedia¹², Aaron Gan³, Hannah J. Williams¹⁴⁵, Andreagiovanni Reina¹²⁵, Heiko Hamann¹²
¹ Centre for the Advanced Study of Collective Behaviour, Konstanz, Germany ² Dep. of Computer and Information Science, University of Konstanz, Germany ³ University of Pittsburgh, Pittsburgh, USA ⁴ Department of Biology, University of Konstanz, Konstanz, Germany ⁵ Max Planck Institute of Animal Behavior, Konstanz, Germany
- Supplementary Material for SAB 2026
- Abstract
- Paper and Code
- Reproducibility
- Speed-Weighted Couzin Controller — Pseudocode
- Extended Results: 5 m/s Wind Conditions
- Full γ-Sweep: Paired Differences Across All Environments
- Ablation: Luffing vs. Speed-Weighting
- Hardware: Aqua Flash Sailboat
- Acknowledgments
- Contact
Abstract
Collective behavior models such as aggregation and flocking usually assume self-propelled robots that can directly execute their desired speed and direction of motion. Autonomous sailing robots violate this assumption: their motion is shaped by wind-dependent propulsion, restricted headings, and spatially varying wind conditions. We introduce SailSwarmSwIM, a reduced-order simulator for autonomous sailing robot swarms, and a speed-weighted Couzin controller paired with a sail-luffing speed-equalization layer. Across four wind conditions, moderate slow-neighbor weighting (small positive γ) improves polarization, reduces close encounters, and tightens cohesion, while strong weighting in either direction reveals distinct failure modes. An ablation isolates the two mechanisms: luffing supplies most of the absolute safety and cohesion gain at the operating point, while the speed-weighting exponent γ governs the alignment–cohesion tradeoff across the sweep.
Paper and Code
| Resource | Link |
|---|---|
| Preprint (PDF) | Download |
| arXiv page | arxiv.org/abs/2605.27422 |
| Simulator source | github.com/praked/SailSwarmSwIM |
| Hardware platform (Aqua Flash) | overhead video below |
Reproducibility
Install
# Editable / dev install (recommended for reproducing the sweep)
git clone https://github.com/praked/SailSwarmSwIM.git
cd SailSwarmSwIM
pip install -e .
A plain install is also available:
pip install git+https://github.com/praked/SailSwarmSwIM.git
Default parameters
These are the values used throughout the paper (also given in Table 1 of the main text):
| Parameter | Value | Meaning |
|---|---|---|
N | 10 | number of robots |
Lh | 35 m | arena half-size |
dt | 1 s | simulation step |
T | 300 s | run horizon |
R0 | central disk | initial spawn radius |
αng | 45° | no-go half-angle |
rrep | 4 m | social repulsion radius |
rori | 10 m | orientation radius |
ratt | 18 m | attraction radius |
dnear | 1.0 m | unsafe-proximity (event logging) threshold |
drep | 1.5 m | hard-repulsion activation threshold |
kp | 0.4 | luffing proportional gain |
trim_rate | 0.05 | luffing trim rate limit (per step) |
ε | 0.1 | regularization in Eq. (6) |
εv | 1e-3 | regularization in the trim law |
γ | sweep [−2, 10] | speed-weighting exponent |
| seeds | 50 | per (controller, wind) cell |
| wind | {5, 10} m/s × {steady, gusty} | four conditions |
Speed-Weighted Couzin Controller — Pseudocode
The controller computes a desired social heading per robot, then projects it through the sailing-feasibility layer (no-go cone + tacking). The repulsion term is never speed-weighted; only orientation and attraction are. Sail luffing is a separate speed-equalization layer that drives each boat toward its neighborhood mean speed.
Input: robot i at position pᵢ, heading ψᵢ, speed vᵢ, trim τᵢ
neighbors j ∈ Nᵢ with (pⱼ, ψⱼ, vⱼ)
zones rrep < rori < ratt
exponent γ (slow-fast axis)
constants ε, εv > 0 (regularization)
gains kp, trim_rate
# 1. Partition neighbors by distance
for j in Nᵢ:
dᵢⱼ = ‖pⱼ − pᵢ‖
r̂ᵢⱼ = (pⱼ − pᵢ) / dᵢⱼ
êⱼ = (cos ψⱼ, sin ψⱼ)
R = { j : dᵢⱼ < rrep } # repulsion
O = { j : rrep ≤ dᵢⱼ < rori } # orientation
A = { j : rori ≤ dᵢⱼ < ratt } # attraction
# 2. If any neighbor in R, repulsion overrides (uniform, never speed-weighted)
if R ≠ ∅:
d_social = −Σ_{j∈R} r̂ᵢⱼ # Eq. (5)
else:
# 3. Speed-weighted social vector (Eqs. 6–7)
for j in O ∪ A:
wᵢⱼ = 1 / (vⱼ + ε)^γ
o_γ = Σ_{j∈O} wᵢⱼ · êⱼ
a_γ = Σ_{j∈A} wᵢⱼ · r̂ᵢⱼ
d_social = o_γ + a_γ
# 4. Map social vector to a desired heading
ψ* = atan2(d_social.y, d_social.x)
# 5. Project onto sailing-feasible cone (Eqs. 3–4)
δ = wrap(ψ* − θ_w(pᵢ, t))
if |δ| < α_ng: # inside no-go cone
ψ̃ = θ_w(pᵢ, t) + sign(δ) · α_ng # snap to close-hauled, then tack
else:
ψ̃ = ψ*
# 6. Sail luffing for speed equalization (Eqs. 8, trim law)
# Rate-limited proportional control toward the neighborhood mean speed.
v̄ = mean({vⱼ : j ∈ Nᵢ})
if Nᵢ ≠ ∅:
τ_des = τᵢ − kp · (vᵢ − v̄) / max(v̄, εv) # faster than mean → ease
else:
τ_des = 1 # no neighbors → full power
τᵢ = clip(τᵢ + clip(τ_des − τᵢ, −trim_rate, +trim_rate), 0, 1) # rate-limited update
# Depower factor (βᵢ = apparent-wind angle off the bow:
# 0° = head-to-wind, 180° = dead downwind). Easing bites hardest
# upwind (lift-driven), does nothing dead downwind (drag-driven).
power_factor = 1 − (1 − βᵢ / 180°)² · (1 − τᵢ)
# 7. Hand off to low-level sailing dynamics
return desired_heading = ψ̃, sail_trim = τᵢ
Convention note. The paper measures βᵢ from head-to-wind (0°), matching standard sailing (AWA) convention. The simulator’s internal angle is measured from downwind, i.e.
β_code = 180° − βᵢ; substituting(β_code/180°)²recovers the same depower factor, so the code and paper agree.
The interpretation of γ is:
| γ | Behavior | Effect |
|---|---|---|
γ < 0 | fast-neighbor following | heading dominated by quickest movers |
γ = 0 | uniform Couzin (with luffing) | classical zonal weighting |
0 < γ ≲ 0.3 | operating regime | improves all three metrics in all four winds |
γ ≳ 1 | slow-neighbor anchoring | cohesion gains, alignment cost |
γ → 10 | over-anchoring | flock compact but disordered |
Extended Results: 5 m/s Wind Conditions
The main text plots the γ-sweep for the two 10 m/s environments (Fig. 2). For completeness, the corresponding panels for the 5 m/s steady and 5 m/s + gusts environments are shown in Figures S1–S3 below. Same convention throughout: median paired difference relative to the uniform Couzin baseline over 50 seed-matched runs, with IQR error bars; red markers are significant under Holm-corrected Wilcoxon (p < 0.05).
Figure S1. Alignment (polarization) as a function of γ in the 5 m/s environments. Higher is better. Steady-state values across 50 runs.
Figure S2. Safety (cumulative unsafe proximity events) as a function of γ in the 5 m/s environments. Lower is safer. Steady-state values across 50 runs.
Convex-hull area sweep
Figure S3. Median paired ΔAhull as a function of γ for all four wind conditions. Negative is better. Note the asymmetric failure modes: at γ = −2 the flock stretches (largest in 10 m/s + gusts); at γ = 10 cohesion reverses sign and the flock disperses under steady 10 m/s wind.
Full γ-Sweep: Paired Differences Across All Environments
These figures report the median paired difference (treatment − reference) for all three metrics across all four wind conditions; error bars show the IQR, and red points are significant improvements under Holm-corrected Wilcoxon (p < 0.05). Two reference points are used, and the contrast between them is informative. Against the uniform Couzin baseline (no luffing), almost every γ improves area and safety — the combined effect of speed-weighting and luffing, and the all-environment extension of the main-text Fig. 2. Against γ = 0 with luffing already active, only the marginal effect of the weighting exponent remains: it is significant mainly for polarisation (the central-band inverted-U) and at the extremes for area and collisions.
Relative to the uniform Couzin baseline (no luffing) — combined effect
Figure S4. Median paired Δ flock area vs. γ, relative to the uniform Couzin baseline. Negative is better (tighter flock). Significant tightening spans nearly the whole mid-range of γ in all four environments; only strong fast-following (γ ≤ −1.5) and over-anchoring (γ = 10) fail to improve or inflate the flock.
Figure S5. Median paired Δ cumulative collisions vs. γ, relative to the uniform Couzin baseline. Negative is better (fewer collisions). Significant reductions span most of the γ range across all four environments.
Figure S6. Median paired Δ polarisation vs. γ, relative to the uniform Couzin baseline. Positive is better (stronger alignment). A central band of small γ gives significant gains in all four environments; strong fast-following and strong anchoring reduce alignment.
Relative to γ = 0 with luffing — isolating the weighting exponent
Figure S7. Median paired Δ flock area vs. γ, relative to γ = 0 with luffing active. Negative is better. With luffing held on, the weighting exponent’s marginal effect on area is small and significant only in a few mid-range cells; the extremes (γ ≤ −1.5, γ = 10) still inflate the flock.
Figure S8. Median paired Δ cumulative collisions vs. γ, relative to γ = 0 with luffing active. Negative is better. With luffing held on, further collision reductions from the weighting exponent are significant only at large γ (notably γ = 10) in the higher-energy environments.
Figure S9. Median paired Δ polarisation vs. γ, relative to γ = 0 with luffing active. Positive is better. Even with luffing held on, the weighting exponent produces a clear inverted-U: a central band of small γ gives significant gains across all four environments.
Ablation: Luffing vs. Speed-Weighting
Because every speed-weighted controller includes the sail-luffing layer while the uniform Couzin baseline does not, improvements reported against the baseline reflect the combined action of two mechanisms. This ablation separates them by re-running a representative set of γ values with and without the luffing layer: in Figure S4 each γ appears as a solid box (with luffing) beside a hatched box (same γ, luffing removed).
Figure S10. Ablation isolating the sail-luffing layer. Cohesion (top, flock area — lower is tighter), alignment (middle — higher is better), and safety (bottom — lower is safer) across the four wind conditions. For each γ, the solid box is with luffing and the adjacent hatched box is the same γ with luffing removed. Removing luffing widens the flock and raises unsafe-proximity counts — most visibly in the 10 m/s and gusty environments — while the γ-ordering (the inverted-U in alignment, the rise in area toward γ = 10) persists with luffing held constant, isolating that structure as the speed-weighting contribution.
How to read the decomposition. The two mechanisms occupy different axes:
| Contribution | Isolated by | What it explains |
|---|---|---|
| Luffing (speed equalization) | solid vs. hatched box at matched γ (Fig. S4) | most of the absolute cohesion and safety gain over baseline |
| Speed-weighting (social geometry) | variation across the γ-sweep (luffing held constant) | the inverted-U in alignment, the safety plateau, and the over-anchoring tradeoff |
Because luffing is identical across the entire γ-sweep, it cannot account for any γ-dependent structure: the shape of the sweep — including the failure modes at γ = −2 and γ = 10 — is attributable to speed-weighting. The recommended setting (small positive γ) secures the luffing-driven safety and cohesion gains without the alignment loss incurred at large γ.
Hardware: Aqua Flash Sailboat
The simulator is calibrated against the Aqua Flash autonomous sailing platform deployed on Lake Constance. The overhead video below shows live sailing maneuvers — including tacking through the no-go cone — that the SailSwarmSwIM dynamics layer is designed to capture in reduced-order form.
Sailing Maneuvers on Lake Constance by Aqua Flash sailboat robot (Overhead View)
Acknowledgments
This work has been supported by the DFG under Germany’s Excellence Strategy, EXC 2117 – 422037984.
Contact
For questions on the simulator or the experiments, please open an issue on github.com/praked/SailSwarmSwIM or get in touch.