This simulation follows a few simple axioms that couple motion, sensing, social dynamics, and morale.
Axioms
- Agents: Each fly has position x, velocity v, health h∈[0,1], and a 3‑channel opinion q=[q0,q1,q2].
- Fields: Placed objects are attractors (houses) or repellents (hazards). They exert 1/r² forces and inject local sensing into the matching opinion channel.
- Self‑propulsion: A motor + damping maintains motion with a minimum cruising speed; neutrals add correlated exploration noise.
- Awareness: Opinion strength |q| raises sensitivity to fields and social terms; like‑minded neighbors reinforce opinions.
- Allegiance: If max(qk) exceeds a threshold, allegiance=k. Allegiant flies orbit the nearest same‑channel flag (spring + swirl).
- Social + Combat: Similar opinions align; opposed opinions anti‑align and can chase and attack at close range (health reduces speed).
- Morale: Under local dominance and low health/weak belief, opinions drift toward the dominant side (allegiance can switch).
- Events: Hazards pulse (expanding ring) that temporarily amplifies repulsion/damage on the ring.
Controls & Legend
- Place: Click to add Houses (attractors) or Hazards (repellents). Shift‑click removes nearest.
- HUD: Shows counts, average health, and clashes. Thin colored lines indicate flag influence on flies.
- Panels: Math toggles this help; Pause halts motion; Reset restores defaults; Clear removes objects.