Class LinearGeometry


public class LinearGeometry extends AbstractLattice
Linear (1D lattice) geometry that supports asymmetric neighbourhoods and optional fixed boundaries.
  • Field Details

    • linearAsymmetry

      private int linearAsymmetry
      Difference between the number of neighbours on the left vs right.
  • Constructor Details

    • LinearGeometry

      public LinearGeometry(EvoLudo engine)
      Create a linear (1D lattice) geometry attached 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 linear chain (1D lattice). With asymmetric neighbours and fixed boundaries this represents the simplest suppressor of selection.

      Requirements/notes:

      1. Supports different numbers of neighbours to the left and right.
      2. For inter-species interactions connectivities are incremented by one and a connectivity of 1 is admissible.
      3. Boundaries can be fixed or periodic (default).
      Specified by:
      init in class AbstractGeometry
    • setLinearAsymmetry

      public void setLinearAsymmetry(int asymmetry)
      Set the left-right neighbour difference.
      Parameters:
      asymmetry - positive values favour neighbours on the left
    • getLinearAsymmetry

      public int getLinearAsymmetry()
      Get the current left-right neighbour difference.
      Returns:
      the left-right neighbour difference
    • 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
    • clone

      public LinearGeometry clone()
      Description copied from class: AbstractGeometry
      Clone geometry.

      Requirements/notes:

      1. Overrides clone() in Object but conflicts with GWT's aversion to clone()ing...
      2. Remove @SuppressWarnings("all") to ensure that no other issues crept in when modifying method.
      Overrides:
      clone in class AbstractLattice
      Returns:
      clone of geometry
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractLattice
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class AbstractLattice