Class VonNeumannGeometry


public class VonNeumannGeometry extends SquareGeometry
Square lattice with von Neumann neighbourhood (four nearest neighbours).
  • Constructor Details

    • VonNeumannGeometry

      public VonNeumannGeometry(EvoLudo engine)
      Create a von Neumann square lattice geometry tied to the given engine.
      Parameters:
      engine - EvoLudo pacemaker
  • Method Details

    • parse

      public boolean parse(String arg)
      Description copied from class: AbstractGeometry
      Parse geometry-specific CLI options.
      Overrides:
      parse in class SquareGeometry
      Parameters:
      arg - the argument string without the geometry key
      Returns:
      true if parsing succeeded, false if invalid
    • init

      public void init()
      Description copied from class: SquareGeometry
      Generates square regular lattices with arbitrary neighbourhood sizes. Variant-specific initializers for standard stencils are available to subclasses.

      Requirements/notes:

      1. Population size must be a perfect square \(N=n^2\).
      2. Admissible connectivities are \(4\) (von Neumann) or \((2m+1)^2-1\) for Moore-type stencils.
      3. Inter-species interactions add the focal node as a neighbour and allow connectivity \(1\).
      4. Boundaries are periodic by default but can be fixed.
      Overrides:
      init in class SquareGeometry
    • adjustBoundaries

      private void adjustBoundaries(int side, int fullside, int offset, boolean interspecies)
      Adjust von Neumann neighbourhoods when fixed boundaries are requested.
      Parameters:
      side - side length of the (sub) lattice
      fullside - global side length
      offset - index offset into the population
      interspecies - true if self-links are required
    • checkSettings

      protected boolean checkSettings()
      Description copied from class: AbstractGeometry
      Hook for subclasses to implement geometry specific checks.
      Overrides:
      checkSettings in class SquareGeometry
      Returns:
      true if adjustments require a reset