Class IBSD

All Implemented Interfaces:
Discrete, CLOProvider

public class IBSD extends IBS implements Discrete
Base class for individual based simulation models, IBS, with discrete traits/strategies. This class deals with optimizations, initialization types and statistics but the heavy lifting is done by the IBS parent.
Author:
Christoph Hauert
  • Field Details

    • cloOptimize

      public final CLOption cloOptimize
      Command line option to request optimizations.
  • Constructor Details

    • IBSD

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

    • readStatisticsSample

      public void readStatisticsSample()
      Description copied from class: Model
      Signal that statistics sample is ready to process.
      Overrides:
      readStatisticsSample in class Model
    • resetStatisticsSample

      public void resetStatisticsSample()
      Description copied from class: Model
      Reset statistics and get ready to start new collection.
      Overrides:
      resetStatisticsSample in class Model
    • permitsSampleStatistics

      public boolean permitsSampleStatistics()
      Description copied from class: Model
      Check if the current model settings permit sample statistics. Fixation probabilities and times are examples of statistics based on samples.
      Overrides:
      permitsSampleStatistics in class IBS
      Returns:
      true if sample statistics are permitted
    • unload

      public void unload()
      Description copied from class: Model
      Milestone: Unload this model and free resources (if applicable).
      Overrides:
      unload in class IBS
      See Also:
    • check

      public boolean check()
      Description copied from class: Model
      Check consistency of parameters and adjust if necessary (and possible). All issues and modifications should be reported through logger. Some parameters can be adjusted while the model remains active or even while running, whereas others require a reset. An example of the former category is in general simple adjustments of payoffs, while an example of the latter category is a change of the population structure.
      Overrides:
      check in class IBS
      Returns:
      true if reset required
      See Also:
    • getIBSDPopulation

      IBSDPopulation getIBSDPopulation(int id)
      Helper routine to retrieve the IBSDPopulation associated with module with id.
      Parameters:
      id - the id of the module
      Returns:
      the IBSDPopulation
    • setInitialTraits

      public boolean setInitialTraits(double[] init)
      Description copied from class: Model
      Set initial traits in one or all species.

      NOTE: this is a convenience method for multi-species modules to set inital states efficiently for interactions with GUI.

      Overrides:
      setInitialTraits in class Model
      Parameters:
      init - the array with the initial trait values
      Returns:
      true if initial traits successfully set
    • setInitialTraits

      public boolean setInitialTraits(int id, double[] init)
      Description copied from class: Model
      Set initial trait values for species with ID id.
      Overrides:
      setInitialTraits in class Model
      Parameters:
      id - the species identifier
      init - the array with the initial trait values
      Returns:
      true if initial traits successfully set
    • getMonoScore

      public double getMonoScore(int id, int idx)
      Description copied from interface: Discrete
      Calculate and return the payoff/score of individuals in monomorphic populations with trait/strategy idx but also deals with payoff accounting (averaged versus accumulated).
      Specified by:
      getMonoScore in interface Discrete
      Parameters:
      id - the id of the population for multi-species models
      idx - trait/strategy
      Returns:
      payoff/score in monomorphic population with trait/strategy idx. Returns NaN if scores ill defined
      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: