Class IBSC

All Implemented Interfaces:
Continuous, CLOProvider

public class IBSC extends IBS implements Continuous
Base class for individual based simulation models, IBS, with a single or multiple continuous traits/strategies. This class deals with initialization and mutation types but the heavy lifting is done by the IBS parent.
Author:
Christoph Hauert
  • Constructor Details

    • IBSC

      public IBSC(EvoLudo engine)
      Creates a population of individuals for IBS simulations with continuous traits/strategies.
      Parameters:
      engine - the pacemaker for running the model
  • Method Details

    • getIBSMCPopulation

      IBSMCPopulation getIBSMCPopulation(int id)
      Helper routine to retrieve the IBSPopulation associated with module with id.
      Parameters:
      id - the id of the module
      Returns:
      the IBSPopulation
    • getTraitMin

      public double[] getTraitMin(int id)
      Description copied from interface: Continuous
      Gets the minimum trait values in this module.
      Specified by:
      getTraitMin in interface Continuous
      Parameters:
      id - the id of the population for multi-species models
      Returns:
      the array with the minimum trait values
    • getTraitMax

      public double[] getTraitMax(int id)
      Description copied from interface: Continuous
      Gets the maximum trait values in this module.
      Specified by:
      getTraitMax in interface Continuous
      Parameters:
      id - the id of the population for multi-species models
      Returns:
      the array with the maximum trait values
    • getMinMonoScore

      public double getMinMonoScore(int id)
      Description copied from interface: Continuous
      Calculates and returns minimum score in monomorphic population. This depends on the payoff accounting (averaged versus accumulated) as well as the Geometry. Since modules are agnostic of runtime details, the request is simply forwarded to the current Model together with the species ID for multi-species modules.
      Specified by:
      getMinMonoScore in interface Continuous
      Parameters:
      id - the id of the population for multi-species models
      Returns:
      the minimum monomorphic score
    • getMaxMonoScore

      public double getMaxMonoScore(int id)
      Description copied from interface: Continuous
      Calculates and returns maximum score in monomorphic population. This depends on the payoff accounting (averaged versus accumulated) as well as the Geometry. Since modules are agnostic of runtime details, the request is simply forwarded to the current Model together with the species ID for multi-species modules.
      Specified by:
      getMaxMonoScore in interface Continuous
      Parameters:
      id - the id of the population for multi-species models
      Returns:
      the maximum monomorphic score
    • getTraitHistogramData

      public void getTraitHistogramData(int id, double[][] bins)
      Description copied from interface: Continuous
      Gets the histogram of the trait distributions and returns the data in an array bins, where the first index denotes the trait (in case there are multiple) and the second index refers to the bins in the histogram.

      This is a helper method to forward the request to the appropriate IBSMCPopulation (for multiple traits) or IBSCPopulation (for single traits).

      Specified by:
      getTraitHistogramData in interface Continuous
      Parameters:
      id - the id of the population for multi-species models
      bins - the 2D data array for storing the histogram
    • get2DTraitHistogramData

      public void get2DTraitHistogramData(int id, double[] bins, int trait1, int trait2)
      Description copied from interface: Continuous
      Gets the histogram of the trait distribution for the traits of the Module. For modules with multiple traits a 2D histogram is generated for traits trait1 and trait2. The histogram is returned in the linear array bins and arranged in a way that is compatible with square lattice geometries for visualization by Distribution (GWT only). For modules with a single trait only, trait1 and trait2 are ignored.
      Specified by:
      get2DTraitHistogramData in interface Continuous
      Parameters:
      id - the id of the population for multi-species models
      bins - the data array for storing the histogram
      trait1 - the index of the first trait (horizontal axis)
      trait2 - the index of the second trait (vertical axis)
      See Also:
    • collectCLO

      public void collectCLO(CLOParser parser)
      Description copied from interface: CLOProvider
      All providers of command line options must implement this method to collect their options.

      Each command line option is (uniquely) identified by it's name (see CLOption.getName()), which corresponds to the long version of the option. If an attempt is made to add an option with a name that already exists, the parser issues a warning and ignores the option. Thus, in general, implementing subclasses should first register their options and call super.collectCLO(CLOParser) at the end such that subclasses are able to override command line options specified in a parental class.

      Override this method in subclasses to add further command line options. Subclasses must make sure that they include a call to super.

      Specified by:
      collectCLO in interface CLOProvider
      Overrides:
      collectCLO in class IBS
      Parameters:
      parser - the reference to parser that manages command line options
      See Also: