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
-
Nested Class Summary
Nested classes/interfaces inherited from interface Features
Features.Groups, Features.Pairs, Features.Static
Nested classes/interfaces inherited from interface IBS.HasIBS
IBS.HasIBS.CGroups, IBS.HasIBS.CPairs, IBS.HasIBS.DGroups, IBS.HasIBS.DPairs, IBS.HasIBS.MCGroups, IBS.HasIBS.MCPairs
-
Method Summary
Modifier and TypeMethodDescriptionvoid
mixedScores
(int[] traitCount, double[] traitScore) Calculate the average payoff/score in a finite population with the number of each trait/strategy provided incount
for pairwise interactions.double
pairScores
(int me, int[] traitCount, double[] traitScore) Calculate and return total (accumulated) payoff/score for pairwise interactions of the focal individual with trait/strategyme
against opponents with different traits/strategies.Methods inherited from interface Features.Pairs
isPairwise
Methods inherited from interface IBS.HasIBS
createIBS
-
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/strategyme
against opponents with different traits/strategies. The respective numbers of each of thenTraits
opponent traits/strategies are provided in the arraytCount
. The payoffs/scores for each of thenTraits
opponent traits/strategies 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 seeIBS.HasIBS.DGroups.groupScores(int[], double[])
.- Parameters:
me
- the trait index of the focal individualtraitCount
- number of opponents with each trait/strategytraitScore
- array for returning the scores of each opponent trait/strategy- 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/strategy provided incount
for pairwise interactions. The payoffs/scores for each of thenTraits
traits/strategies 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[])
orIBS.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()
(seeCXPopulation
for an example).- Parameters:
traitCount
- number of individuals for each trait/strategytraitScore
- array for returning the payoffs/scores of each trait/strategy
-