Class DemesTBT

All Implemented Interfaces:
Runnable, IBS.HasIBS, IBS.HasIBS.DPairs, MilestoneListener, ODE.HasDE, ODE.HasODE, PDE.HasPDE, SDE.HasSDE, Features, Features.Pairs, HasHistogram, HasHistogram.Degree, HasHistogram.Fitness, HasHistogram.StatisticsProbability, HasHistogram.StatisticsStationary, HasHistogram.StatisticsTime, HasMean, HasMean.Fitness, HasMean.Strategy, HasPop2D, HasPop2D.Fitness, HasPop2D.Strategy, HasPop3D, HasPop3D.Fitness, HasPop3D.Strategy, CLOProvider

public class DemesTBT extends TBT
Simulations of 2x2 games in deme structured populations.
Author:
Christoph Hauert
  • Field Details

    • nDemes

      int nDemes
      The number of demes.
    • sizeDemes

      int sizeDemes
      The size of each deme.
  • Constructor Details

    • DemesTBT

      public DemesTBT(EvoLudo engine)
      Create a new instance of the DemesTBT module.
      Parameters:
      engine - the pace maker of the simulation
  • Method Details

    • getModelTypes

      public Type[] getModelTypes()
      Return array of Model types that this Module supports.

      Currently only IBS models are supported even though super supports more.

      Overrides:
      getModelTypes in class Module
      Returns:
      the array of supported Model types
    • getKey

      public String getKey()
      Description copied from class: Module
      Returns identifier of the active module. For example, 2x2 games in TBT return "2x2". This corresponds to the argument for the --module option to load a particular module. The default is to use the class name.
      Overrides:
      getKey in class TBT
      Returns:
      the identifying key of this module
    • getAuthors

      public String getAuthors()
      Description copied from class: Module
      Returns a string with information about the authors of the module.
      Overrides:
      getAuthors in class TBT
      Returns:
      the names of the authors
    • getTitle

      public String getTitle()
      Description copied from class: Module
      Returns title of active module, e.g. 2x2 games in TBT returns "2x2 Games".
      Overrides:
      getTitle in class TBT
      Returns:
      the title of active module
    • mixedScores

      public void mixedScores(int[] count, double[] traitScores)
      Description copied from interface: IBS.HasIBS.DPairs
      Calculate the average payoff/score in a finite population with the number of each trait/strategy provided in count for pairwise interactions. The payoffs/scores for each of the nTraits traits/strategies must be stored and returned in the array traitScores.

      Important: must be overridden and implemented in subclasses that define game interactions in well-mixed populations where individuals interact with everyone else. Computationally it is not feasible to cover this scenario with IBS.HasIBS.DPairs.pairScores(int, int[], double[]) or IBS.HasIBS.DGroups.groupScores(int[], double[]), respectively.

      Note: If explicit calculations of the well-mixed scores are not available, interactions with everyone in well-mixed populations should checked for and excluded with a warning in IBS.check() (see CXPopulation for an example).

      Specified by:
      mixedScores in interface IBS.HasIBS.DPairs
      Overrides:
      mixedScores in class TBT
      Parameters:
      count - number of individuals for each trait/strategy
      traitScores - array for returning the payoffs/scores of each trait/strategy
    • adjustCLO

      public void adjustCLO(CLOParser parser)
      Description copied from interface: CLOProvider
      Providers of command line options may want to remove certain options that other providers provided by overriding this method. After all command line options are collected, all providers get a chance to adjust the collection. In particular, options should be removed that do not make sense in present context. Overriding methods usually call CLOParser.removeCLO(String[]) or variants thereof.
      Specified by:
      adjustCLO in interface CLOProvider
      Overrides:
      adjustCLO in class TBT
      Parameters:
      parser - the reference to parser that manages command line options
      See Also:
    • getNDemes

      public int getNDemes()
      Return the number of demes.
      Returns:
      the number of demes
    • getSizeDemes

      public int getSizeDemes()
      Return the size of each demes.
      Returns:
      the size of one demes
    • createIBSPop

      public DemesTBT.IBSPop createIBSPop()
      Description copied from class: Module
      Opportunity to supply custom individual based simulations.
      Overrides:
      createIBSPop in class TBT
      Returns:
      the custom IBSPopulation or null to use default.