Interface CellularAutomaton<S>

All Known Implementing Classes:
ConwayLife

public interface CellularAutomaton<S>
Interface for Cellular Automata.

A cellular automaton is a discrete model studied in computability theory, mathematics, physics, and theoretical biology. It consists of a grid of cells, each in one of a finite number of states, evolving through discrete time steps according to local rules.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    default long
    Returns the current generation number.
    int
    Gets the height of the grid.
    getState(int x, int y)
    Gets the state of the cell at the specified coordinates.
    int
    Gets the width of the grid.
    void
    Advances the automaton by one generation.
    default void
    Resets the automaton to initial state.
    void
    setState(int x, int y, S state)
    Sets the state of the cell at the specified coordinates.
  • Method Details

    • nextGeneration

      void nextGeneration()
      Advances the automaton by one generation.
    • getState

      S getState(int x, int y)
      Gets the state of the cell at the specified coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      Returns:
      the state at (x, y)
    • setState

      void setState(int x, int y, S state)
      Sets the state of the cell at the specified coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      state - the new state
    • getWidth

      int getWidth()
      Gets the width of the grid.
      Returns:
      grid width
    • getHeight

      int getHeight()
      Gets the height of the grid.
      Returns:
      grid height
    • getGeneration

      default long getGeneration()
      Returns the current generation number.
      Returns:
      generation count
    • reset

      default void reset()
      Resets the automaton to initial state.