Interface IBS.HasIBS.DGroups
- All Superinterfaces:
Features
,Features.Groups
,Features.Pairs
,IBS.HasIBS
,IBS.HasIBS.DPairs
- 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
groupScores
(int[] traitCount, double[] traitScore) Calculate the payoff/score for interactions in groups consisting of traits/strategies with respective numbers given in the arraytCount
.default 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.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 incount
for interaction groups of sizen
.Methods inherited from interface Features.Groups
getNGroup, isPairwise
Methods inherited from interface IBS.HasIBS
createIBS
Methods inherited from interface IBS.HasIBS.DPairs
pairScores
-
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 arraytCount
. The interaction group size is given by the sum overtCount[i]
fori=0,1,...,nTraits
. The payoffs/scores for each of thenTraits
traits/strategies must be stored and returned in the arraytScore
.Important: must be overridden and implemented in subclasses that define game interactions among groups of individuals (for groups with sizes
nGroup>2
, otherwise seeIBS.HasIBS.DPairs.pairScores(int, int[], double[])
).- Parameters:
traitCount
- group composition given by the number of individuals with each trait/strategytraitScore
- 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 incount
for interaction groups of sizen
. The payoffs/scores for each of thenTraits
traits/strategies must be stored and returned in the arraytraitScores
.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
IBS.check()
(seeIBSMCPopulation
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 withIBS.HasIBS.DPairs.pairScores(int, int[], double[])
orgroupScores(int[], double[])
, respectively.- Parameters:
traitCount
- number of individuals for each trait/strategyn
- interaction group sizetraitScore
- 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 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
IBS.HasIBS.DPairs.pairScores(int, int[], double[])
orgroupScores(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).- Specified by:
mixedScores
in interfaceIBS.HasIBS.DPairs
- Parameters:
traitCount
- number of individuals for each trait/strategytraitScore
- array for returning the payoffs/scores of each trait/strategy
-