Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 1.59 KB

File metadata and controls

36 lines (24 loc) · 1.59 KB

Color Patches

This is a cellular automaton model where each agent lives in a cell on a 2D grid, and never moves.

An agent's state represents its "opinion" and is shown by the color of the cell the agent lives in. Each color represents an opinion - there are 16 of them. At each time step, an agent's opinion is influenced by that of its neighbors, and changes to the most common one found; ties are randomly arbitrated. As an agent adapts its thinking to that of its neighbors, the cell color changes.

Parameters you can play with:

(you must change the code to alter the parameters at this stage)

  • Vary the number of opinions.
  • Vary the size of the grid
  • Change the grid from fixed borders to a torus continuum

Observe

  • how groups of like minded agents form and evolve
  • how sometimes a single opinion prevails
  • how some minority or fragmented opinions rapidly disappear

How to Run

To run the model interactively, run Solara in this directory. e.g.

    $ solara run app.py

Then open your browser to http://localhost:8765/ and press Reset, then Run.

Files

  • color_patches/model.py: Defines the cell and model classes. The cell class governs each cell's behavior. The model class itself controls the lattice on which the cells live and interact.
  • app.py: Launches an interactive SolaraViz visualization.

Further Reading

Inspired from this model from San Jose University
Other similar models: Schelling Segregation Model