Class TBT.IBSPop

Direct Known Subclasses:
ATBT.ATBTPop, DemesTBT.IBSPop
Enclosing class:
TBT

public class TBT.IBSPop extends IBSDPopulation
The extension for IBS simulations specific to populations engaging in 2×2 games. This extension implements customizations for Geometry.Type.SQUARE_NEUMANN_2ND as well as specific initial conditions that give rise to fascinating evolutionary kaleidoscopes for deterministic updating.
  • Field Details

    • tsMean

      double tsMean
      Timestamp for the last mean trait calculation.
    • tsFit

      double tsFit
      Timestamp for the last fitness calculation.
    • tsTraits

      double[] tsTraits
      The trait frequencies for the two sublattices for Geometry.Type.SQUARE_NEUMANN_2ND.
    • tsFits

      double[] tsFits
      The trait fitnesses for the two sublattices for Geometry.Type.SQUARE_NEUMANN_2ND.
  • Constructor Details

    • IBSPop

      protected IBSPop(EvoLudo engine, TBT module)
      Create a new instance of the IBS model for 2×2 games.
      Parameters:
      engine - the pacemaker for running the model
      module - the module that defines the game
  • Method Details

    • check

      public boolean check()
      Description copied from class: IBSPopulation
      Check all model parameters for consistency and adjust if necessary (and feasible). Returns true if adjustments require a reset. Free memory if possible and request a reset if new memory needs to be allocated.
      Overrides:
      check in class IBSDPopulation
      Returns:
      true if reset is required
      See Also:
    • getTraitNameAt

      public String getTraitNameAt(int idx)
      Description copied from class: IBSPopulation
      Gets the formatted name of the trait of the individual at site index.
      Overrides:
      getTraitNameAt in class IBSDPopulation
      Parameters:
      idx - the index of the
      Returns:
      the string describing the trait
    • getNMean

      public int getNMean()
      Description copied from class: IBSPopulation
      Return the number of mean values for this population (for traits or fitness).

      Note: The number of mean traits in a model may differ from the number of traits in the corresponding module. This is the case for example for Geometry.Type.SQUARE_NEUMANN_2ND with two disjoint interaction or competition graphs.

      Overrides:
      getNMean in class IBSPopulation
      Returns:
      the number of mean values
      See Also:
    • getMeanTraits

      public void getMeanTraits(double[] mean)
      Description copied from class: IBSPopulation
      Returns the mean trait(s) of this population in the array mean. Used by GUI to visualize the current state of this IBS model.
      Overrides:
      getMeanTraits in class IBSDPopulation
      Parameters:
      mean - the array for returning the trait values
      See Also:
    • getMeanFitness

      public void getMeanFitness(double[] mean)
      Description copied from class: IBSPopulation
      Returns the mean fitness of this population in the array mean. Used by GUI to visualize the current state of this IBS model. Returns true if data point belongs to the same time series and false if a new series was started through IBSPopulation.init() or IBSPopulation.reset().
      Overrides:
      getMeanFitness in class IBSDPopulation
      Parameters:
      mean - the array for storing the mean fitness values
      See Also:
    • getStatus

      public String getStatus()
      Description copied from class: IBSPopulation
      Gets the status of the as a formatted string. This is typically used in the GUI to summarize the progress of the model.
      Overrides:
      getStatus in class IBSDPopulation
      Returns:
      the status of the population
    • initKaleidoscope

      protected void initKaleidoscope()
      Description copied from class: IBSDPopulation
      Initial configuration that generates evolutionary kaleidoscopes for deterministic update rules. Whether this is possible and and what kind of initial configurations are required depends on the module. Hence this method must be overriden in subclasses that admit kaleidoscopes.

      Note: requires the explicit adding of the key IBSD.Init.Type.KALEIDOSCOPE for IBS models. For example, add

       if (model instanceof IBSD) {
              CLOption clo = ((IBSDPopulation) getIBSPopulation()).getInit().clo;
              clo.addKey(Init.Type.KALEIDOSCOPE);
       }
       
      to org.evoludo.simulator.modules.Module#adjustCLO(org.evoludo.util.CLOParser).
      Overrides:
      initKaleidoscope in class IBSDPopulation
      See Also: