Skip to content

valevalerio/Synchronization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rework of the firefly synchronization project

here - https://gitlab.com/erikfransson/firefly_synchronization

Firefly simulations

Run via

python src/moving_simulation.py

or

python src/grid_simulation.py

Alien Bull Swarm Simulation (NEW!)

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

🎮 Interactive Controls (Real-time)

  • 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

⚡ Performance Modes

  • 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

🧠 Advanced Features

  • 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

🎨 Visual Features

  • 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

🏗️ Technical Specifications

  • 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

Demo

Original Firefly Simulation

Original Firefly Demo

NEW: Alien Bull Swarm Simulation 🚀

Alien Bull Swarm Demo

*Phase-weighted cohesion in action - bulls with similar charge phases flock together*

Screenshots

Ultra-Fast Mode (120+ FPS) Ultra-Fast Mode Minimal UI for maximum performance - perfect for observing pure swarm dynamics

Analysis Mode (Full Visualization) Analysis Mode Complete visualization suite with real-time graphs and connection networks


🎯 Features Implemented

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)

🧠 Algorithmic Innovations

  • 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

About

Firefly and bull-like emergent synchronization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages