Overview
What is a Cellular Automaton?
A Cellular Automaton (CA) is a discrete computational model consisting of a grid of cells, each holding a finite state. At each time step, every cell updates its state according to a fixed transition function that depends on the cell’s current state and the states of its immediate neighbors.
Despite their simple rules, cellular automata can produce remarkably complex behavior — making them a powerful tool for modeling natural phenomena such as population dynamics, fluid flow, landslides, and lava flows.
Formal definition
A Cellular Automaton is formally described as the quadruple <Zd, S, X, σ>:
| Symbol | Meaning | In JCAL |
|---|---|---|
| Zd | A d-dimensional grid of cells | DefaultCell[][] inside CellularAutomata |
| S | The finite set of possible cell states | DefaultStatus instances |
| X | The neighborhood — which cells are considered “neighbors” | DefaultNeighborhood subclass |
| σ | The transition function — one step of evolution | CellularAutomataExecutor subclass |
Neighborhood strategies
The two most common neighborhood shapes are:
- Moore neighborhood — the 8 surrounding cells (orthogonal + diagonal). Use
NeighborhoodType.MOORE. - Von Neumann neighborhood — the 4 orthogonal cells only. Use
NeighborhoodType.VON_NEUMANN.
You can also define a fully custom neighborhood by subclassing DefaultNeighborhood.
Further reading
- Wolfram MathWorld — Cellular Automaton
- The Nature of Code — Chapter 7: Cellular Automata by Daniel Shiffman
What is JCAL?
JCAL was born from the author’s work during a master’s thesis, where a C++ library for Cellular Automata was developed and used by physicists, geologists, and researchers across multiple departments. That library was comprehensive but complex.
JCAL brings the same ideas to Java in a smaller, simpler, and more accessible form.
Design goals
- Minimal boilerplate — define a working CA in a few lines of Java.
- Idiomatic Java — fluent builder API, abstract base classes, standard collections.
- Extensible — swap in custom states, neighborhood shapes, or parallel execution with minimal code changes.
- Complex CA support — custom state objects and a refinement hook enable rich, multi-value simulations beyond simple binary-state automata.
See also
- Getting Started — install JCAL and run your first automaton.
- Implementing a Rule — how to write a transition function.
- Configuration Reference — all builder options explained.