Interface Model.HasIBS.DPairs
- All Superinterfaces:
Features, Features.Pairs, Model.HasIBS
- All Known Subinterfaces:
Model.HasIBS.DGroups
- All Known Implementing Classes:
ATBT, CDL, CDLP, CDLPQ, Centipede, DemesTBT, EcoPGG, Mutualism, RSP, simCDL, simCDLP, simCDLPQ, simTBT, simTraits, TBT, Traits
- Enclosing interface:
Model.HasIBS
- Author:
- Christoph Hauert
-
Nested Class Summary
Nested classes/interfaces inherited from interface Features
Features.Groups, Features.Multispecies, Features.Pairs, Features.Payoffs, Features.StaticNested classes/interfaces inherited from interface Model.HasIBS
Model.HasIBS.CGroups, Model.HasIBS.CPairs, Model.HasIBS.DGroups, Model.HasIBS.DPairs, Model.HasIBS.MCGroups, Model.HasIBS.MCPairs -
Method Summary
Modifier and TypeMethodDescriptionvoidmixedScores(int[] traitCount, double[] traitScore) Calculate the average payoff/score in a finite population with the number of each trait provided incountfor pairwise interactions.doublepairScores(int me, int[] traitCount, double[] traitScore) Calculate and return total (accumulated) payoff/score for pairwise interactions of the focal individual with traitmeagainst opponents with different traits.Methods inherited from interface Features
getTitle, isMultispecies, isStaticMethods inherited from interface Features.Pairs
isPairwise
-
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 traitmeagainst opponents with different traits. The respective numbers of each of thenTraitsopponent traits are provided in the arraytCount. The payoffs/scores for each of thenTraitsopponent traits must be stored and returned in the arraytScore.Important: must be overridden and implemented in subclasses that define game interactions between pairs of individuals (
nGroup=2,pairwise=true), otherwise seeModel.HasIBS.DGroups.groupScores(int[], double[]).- Parameters:
me- the trait index of the focal individualtraitCount- number of opponents with each traittraitScore- array for returning the scores of each opponent trait- Returns:
- score of focal individual
meaccumulated 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 incountfor pairwise interactions. The payoffs/scores for each of thenTraitstraits must be stored and returned in the arraytraitScores.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[])orModel.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
Model.check()(seeCXPopulationfor an example).- Parameters:
traitCount- number of individuals for each traittraitScore- array for returning the payoffs/scores of each trait
-