Create cellular grid
import io.benph.sp.cellsim.grid.Grid;
import io.benph.sp.cellsim.algos.conways.ConwaysCell;
var grid = new Grid<ConwaysCell>(w, h, canGoThroughEdges);
grid.init(x, y -> new ConwaysCell(x, y, isAlive));
Run simulation
import io.benph.sp.cellsim.runner.Runner;
import io.benph.sp.cellsim.algos.conways.Conways;
var runner = new Runner<>(grid, new Conways(), "~/cellular-automaton/export");
// run one iteration
runner.iterate();
// export current state as bmp
runner.dump();
checkout this working example
You can try your custom algorithm by implementing Algorithm and extending Cell classes. This is how Conways and TriColorConways algorithms were implemented.