This implementation of Joshua Epstein’s Civil Violence Model simulates outbreaks of unrest against a central authority by agents questioning its legitimacy.
In this visualization, cops are represented as blue pixels. Civilians are represented by gray, red, or white pixels. Every turn, some civilians will go from inactive (gray) to active (red), depending on their own threshold and the exogenous legitimacy of the government. However, a cop who is next to an active civilian will arrest them (turning them white and unable to move) for a fixed number of turns set by the jail term. By updating parameters for legitimacy, jail term, % full, and % Cops, different dynamics will arise, from a peaceful population to periodic outbursts to near-constant anarchy.