1. Scientific Overview and Theoretical Foundation
Flux Bugs is an advanced, multi-agent educational sandbox exploring decentralized self-organization, emergent pattern formation, and computational entropy. Built as an extension of the classical Turing-complete Langton's Ant cellular automaton, this simulation explores how simple local rules scale into global complex structures—a phenomenon known as **stigmergy**.
In biological systems, cells, neural growth cones, and individual social organisms do not rely on centralized command architectures. Instead, they interact via the continuous modification of their surrounding physical and chemical environment. For instance, in neural tractography and structural axon guidance, growth cones read spatial biochemical footprints deposited by pioneering neurites to dynamically plot long-range networks. Flux Bugs models this by introducing three distinct agent "personalities" (P0, P1, and P2) acting upon a 2D toroidal discrete lattice. As these agents traverse the lattice, they respond to and alter the state of cell matrices, creating expanding geometric feedback loops, stable highways, or chaotic boundaries.
By observing these collective dynamics, students can grasp key principles of cellular automata, phase transitions, and biological morphogenesis. It provides an intuitive, hands-on model demonstrating how order and chaotic turbulence naturally settle from completely deterministic rules.
3. Deep Biophysical Equations & Numerical Solvers
The simulation space is mapped onto a discrete, discrete toroidal lattice $L = \mathbb{Z}_{W} \times \mathbb{Z}_{H}$ where $W$ and $H$ represent the width and height of the grid. Each cell $C(x, y)$ is defined by a coordinate tuple containing state variables:
$$C(x, y) = \langle s, a \rangle$$
where $s \in \{-1, 0, 1, 2\}$ represents the color state of the cell (vacuum background, or red, green, blue trails respectively), and $a \in [0, 255]$ represents the chronological age trace.
A collection of $N$ bugs is modeled. A single bug $B_i$ is represented by:
$$B_i = \langle x_i, y_i, \theta_i, p_i, \sigma_i \rangle$$
where $(x_i, y_i) \in L$ represents the coordinate position, $\theta_i \in \{0, 1, 2, 3\}$ is the direction vector (Up, Right, Down, Left), $p_i \in \{0, 1, 2\}$ denotes the genetic personality, and $\sigma_i$ is the internal cycle state.
At each update interval, every agent modifies its environment and updates its heading according to its internal code:
A. Agent Personalities and Turning Dynamics
- Type P0 (Age-Responsive): Turns left or right depending on whether the cell age $a$ is even or odd:
$$\theta_{i, t+1} = \begin{cases} (\theta_{i, t} - 1) \pmod 4 & \text{if } a_t \bmod 2 \equiv 1 \\ (\theta_{i, t} + 1) \pmod 4 & \text{if } a_t \bmod 2 \equiv 0 \end{cases}$$
This dependency triggers complex geometric patterns as paths overwrite old age signatures.
- Type P1 (Color-Responsive): Performs classic multi-state state machine routing:
$$\theta_{i, t+1} = \begin{cases} (\theta_{i, t} + 1) \pmod 4 & \text{if } s_t = -1 \\ (\theta_{i, t} - 1) \pmod 4 & \text{if } s_t \geq 0 \end{cases}$$
- Type P2 (Stochastic Multi-State): Cycles through states $\sigma_i \in \{A, B, C\}$:
$$\theta_{i, t+1} = \begin{cases} (\theta_{i, t} + 1) \pmod 4 & \text{if } \sigma_i = A \\ (\theta_{i, t} - 1) \pmod 4 & \text{if } \sigma_i = B \\ (\theta_{i, t} + \xi) \pmod 4 & \text{if } \sigma_i = C \end{cases}$$
where $\xi \in \{-1, 1\}$ represents a randomized Bernoulli process with probability $P(\xi = 1) = 0.5$. This induces structural entropy and unpredictable diffusion.
B. Environmental Dissipation and Decay
To model temporal feedback mechanics, cells dissipate active age energy at each step governed by the decay equation:
$$a_{t+1} = \max\left(0, a_t - \gamma\right)$$
When the cell age $a_{t+1}$ returns to $0$, its background state is restored to vacuum ($s = -1$). This allows for transient paths, showing localized patterns fading organically.
C. Audio Synthesis and Wave Shaping
Each bug's action triggers sound feedback synthesized through Web Audio oscillators. We prevent clipping by running the voices through a dynamic compressor limiting threshold at $-20\text{ dB}$, knee at $30\text{ dB}$, and release at $80\text{ ms}$. This converts spatial interaction into a real-time sonified algorithmic symphony.
Open Access License: This interactive educational module is released under
CC BY-NC 4.0 (Attribution-NonCommercial)
for non-commercial research, academic study, and clinical education.
Commercial & Enterprise Licensing: For white-labeling, proprietary LMS/course embedding, hardware dashboard telemetry integration, or custom feature engineering, secure a commercial license at
BioniCloud.com or contact
Dr. Yuri Beno.