This is a small Flask app that simulates and animates random Boolean networks. You pick a number of nodes between 1 and 10 and a random seed value, and it wires together a directed graph where each node is randomly set to on (yellow) or off (purple). At every step, each node looks at which nodes are pointing to it, reads their states as a binary number, and checks a random lookup table to determine its next state.
Because the system is completely deterministic and has a finite number of possible states, it will always end up looping. The simulation runs until it spots a state it has already seen and resets. The State Pattern view shows the entire run all at once, making it easy to see the exact loop the network settles into.
The Network Evolution view lays the nodes out in a circle, with arrows showing the wiring and colors updating step by step. To keep things fast, the default parameters (k=6, s=42) are pre-rendered and served straight from disk, while any custom inputs generate the heat map and animation on the fly.