Interface IBS.HasIBS.DGroups

All Superinterfaces:
Features, Features.Groups, Features.Pairs, IBS.HasIBS, IBS.HasIBS.DPairs
All Known Implementing Classes:
CDL, CDLP, CDLPQ, EcoPGG, simCDL, simCDLP, simCDLPQ
Enclosing interface:
IBS.HasIBS

public static interface IBS.HasIBS.DGroups extends IBS.HasIBS.DPairs, Features.Groups
Modules that offer individual based simulation models with discrete traits and interactions in groups must implement this interface.
  • Method Details

    • groupScores

      void groupScores(int[] traitCount, double[] traitScore)
      Calculate the payoff/score for interactions in groups consisting of traits/strategies with respective numbers given in the array tCount. The interaction group size is given by the sum over tCount[i] for i=0,1,...,nTraits. The payoffs/scores for each of the nTraits traits/strategies must be stored and returned in the array tScore.

      Important: must be overridden and implemented in subclasses that define game interactions among groups of individuals (for groups with sizes nGroup>2, otherwise see IBS.HasIBS.DPairs.pairScores(int, int[], double[])).

      Parameters:
      traitCount - group composition given by the number of individuals with each trait/strategy
      traitScore - array for returning the payoffs/scores of each trait/strategy
    • mixedScores

      void mixedScores(int[] traitCount, int n, double[] traitScore)
      Calculate the average payoff/score in a finite population with the number of each trait/strategy provided in count for interaction groups of size n. The payoffs/scores for each of the nTraits traits/strategies must be stored and returned in the array traitScores.

      Notes:

      For payoff calculations:
      • each strategy sees one less of its own type in its environment
      • the size of the environment is nPopulation-1
      • the fact that the payoff of each strategy does not depend on its own type simplifies things
      If explicit calculations of the well-mixed scores are not available, interactions with everyone in well-mixed populations should be checked for and excluded with a warning in IBS.check() (see IBSMCPopulation for an example).

      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 groupScores(int[], double[]), respectively.
      Parameters:
      traitCount - number of individuals for each trait/strategy
      n - interaction group size
      traitScore - array for returning the payoffs/scores of each trait/strategy
    • mixedScores

      default void mixedScores(int[] traitCount, double[] traitScore)
      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 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
      Parameters:
      traitCount - number of individuals for each trait/strategy
      traitScore - array for returning the payoffs/scores of each trait/strategy