Interface IBS.HasIBS.DPairs

All Superinterfaces:
Features, Features.Pairs, IBS.HasIBS
All Known Subinterfaces:
IBS.HasIBS.DGroups
All Known Implementing Classes:
ATBT, CDL, CDLP, CDLPQ, Centipede, DemesTBT, EcoPGG, RSP, simCDL, simCDLP, simCDLPQ, simTBT, simTraits, TBT, Traits
Enclosing interface:
IBS.HasIBS

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

    • pairScores

      double pairScores(int me, int[] traitCount, double[] traitScore)
      Calculate and return total (accumulated) payoff/score for pairwise interactions of the focal individual with trait me against opponents with different traits. The respective numbers of each of the nTraits opponent traits are provided in the array tCount. The payoffs/scores for each of the nTraits opponent traits must be stored and returned in the array tScore.

      Important: must be overridden and implemented in subclasses that define game interactions between pairs of individuals (nGroup=2, pairwise=true), otherwise see IBS.HasIBS.DGroups.groupScores(int[], double[]).

      Parameters:
      me - the trait index of the focal individual
      traitCount - number of opponents with each trait
      traitScore - array for returning the scores of each opponent trait
      Returns:
      score of focal individual me accumulated over all interactions
    • mixedScores

      void mixedScores(int[] traitCount, double[] traitScore)
      Calculate the average payoff/score in a finite population with the number of each trait provided in count for pairwise interactions. The payoffs/scores for each of the nTraits traits 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 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).

      Parameters:
      traitCount - number of individuals for each trait
      traitScore - array for returning the payoffs/scores of each trait