Class HexagonalGeometry


public class HexagonalGeometry extends AbstractLattice
Honeycomb/hexagonal lattice geometry with optional fixed boundaries.
  • Constructor Details

    • HexagonalGeometry

      public HexagonalGeometry(EvoLudo engine)
      Create a hexagonal (honeycomb) 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 AbstractGeometry
      Parameters:
      arg - the argument string without the geometry key
      Returns:
      true if parsing succeeded, false if invalid
    • init

      public void init()
      Generates a hexagonal (honeycomb) regular lattice with degree \(6\) (or optional self-links when connectivity is set to 1). Fixed boundaries truncate neighbours; periodic boundaries wrap the lattice.
      Specified by:
      init in class AbstractGeometry
    • initK1

      private void initK1()
      Initialize the lattice with self-links only (connectivity 1).
    • fillEvenIRows

      private void fillEvenIRows(int side, boolean interspecies, int x, int u, boolean uNowrap, int d)
      Populate even-index rows for the hexagonal lattice, respecting boundary conditions.
      Parameters:
      side - side length of the lattice
      interspecies - true if interspecific interactions allow self-links
      x - offset for the current row
      u - index offset for the row above
      uNowrap - true if wrapping upward is allowed
      d - index offset for the row below
    • fillOddIRows

      private void fillOddIRows(int side, boolean interspecies, int x, int u, int d, boolean dNowrap)
      Populate odd-index rows for the hexagonal lattice, respecting boundary conditions.
      Parameters:
      side - side length of the lattice
      interspecies - true if interspecific interactions allow self-links
      x - offset for the current row
      u - index offset for the row above
      d - index offset for the row below
      dNowrap - true if wrapping downward is allowed
    • checkSettings

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