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.Multispecies, Features.Pairs, Features.Payoffs, 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 with respective numbers given in the arraytraitCount
.default void
mixedScores
(int[] traitCount, double[] traitScore) Calculate the average payoff/score in a finite population with the number of each trait 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 provided incount
for interaction groups of sizen
.Methods inherited from interface Features
getTitle, isMultispecies, isStatic
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 with respective numbers given in the arraytraitCount
. The interaction group size is given by the sum overtraitCount[i]
fori=0,1,...,nTraits
. The payoffs/scores for each of thenTraits
traits must be stored and returned in the arraytraitScore
.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 traittraitScore
- array for returning the payoffs/scores of each trait
-
mixedScores
void mixedScores(int[] traitCount, int n, double[] traitScore) Calculate the average payoff/score in a finite population with the number of each trait provided incount
for interaction groups of sizen
. The payoffs/scores for each of thenTraits
traits must be stored and returned in the arraytraitScores
.Notes:
For payoff calculations:- each trait 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 trait 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 traitn
- interaction group sizetraitScore
- array for returning the payoffs/scores of each trait
-
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 provided incount
for pairwise interactions. The payoffs/scores for each of thenTraits
traits 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 traittraitScore
- array for returning the payoffs/scores of each trait
-