here - https://gitlab.com/erikfransson/firefly_synchronization
Run via
python src/moving_simulation.py
or
python src/grid_simulation.py
Run the alien bull swarm simulation:
🚀 ULTRA-FAST MODE (recommended):
python src/alien_bull_swarm.py📊 ANALYSIS MODE (with graphs):
python src/alien_bull_with_graphs.py- ESC - Exit simulation
- G - Toggle graphs ON/OFF (6x performance boost when OFF)
- C - Toggle connections ON/OFF (additional speed gain)
- P - Toggle phase-weighted cohesion ON/OFF (smart vs simple clustering)
- H - Show help in console
- Ultra-Fast Mode: 120+ FPS with graphs/connections disabled
- Balanced Mode: ~60 FPS with selective features enabled
- Analysis Mode: ~20 FPS with full visualization suite
- Phase-Weighted Cohesion: Bulls with similar charge phases attract more strongly
- Adaptive Steering: Dynamic steering forces based on movement speed
- Boundary Forces: Soft boundaries keep bulls in view without teleporting
- Real-time Analytics: Live performance metrics and synchronization data
- Smart Initialization: Guaranteed minimum speeds prevent stagnation
- Dynamic Size & Color: Bulls change size and brightness based on charge/activity
- Synchronized Highlighting: Active bulls get special visual effects
- Connection Lines: Optional visualization of neighbor relationships
- Real-time Graphs: Live plotting of charge, intensity, and swarm metrics
- Resolution: 1600x900 full-screen display
- Entity Count: 80 alien bulls with individual AI behavior
- Interaction Range: 100-pixel neighbor detection radius
- Physics: Boids-based flocking with firefly synchronization dynamics
Ultra-Fast Mode (120+ FPS)
Minimal UI for maximum performance - perfect for observing pure swarm dynamics
Analysis Mode (Full Visualization)
Complete visualization suite with real-time graphs and connection networks
✅ Interactive Real-time Controls (G, C, P, H keys)
✅ Phase-Weighted Cohesion Algorithm (smart clustering)
✅ Adaptive Steering System (speed-based steering forces)
✅ Performance Optimization (6x speed boost when graphs disabled)
✅ Boundary Force System (soft boundaries, no teleporting)
✅ Dynamic Visual Effects (size/color changes based on charge)
✅ Real-time Analytics (live performance monitoring)
- Phase-Weighted Cohesion: Bulls attract more strongly to neighbors with similar charge phases
- Adaptive Steering: Steering force intensity varies based on current movement speed
- Synchronization Modulation: Alignment and cohesion forces modulated by charge similarity
- Minimum Speed Maintenance: Prevents entities from getting stuck in low-energy states

