Package org.evoludo.simulator.modules
Class DemesTBT
- All Implemented Interfaces:
Runnable
,IBS.HasIBS
,IBS.HasIBS.DPairs
,MilestoneListener
,ODE.HasDE
,ODE.HasODE
,PDE.HasPDE
,SDE.HasSDE
,Features
,Features.Pairs
,HasHistogram
,HasHistogram.Degree
,HasHistogram.Fitness
,HasHistogram.StatisticsProbability
,HasHistogram.StatisticsStationary
,HasHistogram.StatisticsTime
,HasMean
,HasMean.Fitness
,HasMean.Strategy
,HasPop2D
,HasPop2D.Fitness
,HasPop2D.Strategy
,HasPop3D
,HasPop3D.Fitness
,HasPop3D.Strategy
,CLOProvider
Simulations of 2x2 games in deme structured populations.
- Author:
- Christoph Hauert
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Custom implemenation for individual based simulations in deme structured populations.Nested classes/interfaces inherited from interface Features
Features.Groups, Features.Pairs, Features.Static
Nested classes/interfaces inherited from interface HasHistogram
HasHistogram.Degree, HasHistogram.Fitness, HasHistogram.StatisticsProbability, HasHistogram.StatisticsStationary, HasHistogram.StatisticsTime, HasHistogram.Strategy
Nested classes/interfaces inherited from interface HasMean
HasMean.Fitness, HasMean.Strategy
Nested classes/interfaces inherited from interface HasPop2D
HasPop2D.Fitness, HasPop2D.Strategy
Nested classes/interfaces inherited from interface HasPop3D
HasPop3D.Fitness, HasPop3D.Strategy
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
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
The number of demes.(package private) int
The size of each deme.Fields inherited from class TBT
cloPayoffs, COOPERATE, DEFECT, payoffs
Fields inherited from class Discrete
cloMonoStop, monoStop, mutation, species
Fields inherited from class Module
active, cloDeathRate, cloGeometry, cloNGroup, cloNPopulation, cloPhase2DAxis, cloSpeciesUpdateRate, cloTraitColors, cloTraitDisable, cloTraitNames, competition, deathRate, defaultColor, engine, ibs, ID, interaction, logger, map2fitness, markers, model, nActive, name, nGroup, nPopulation, nTraits, opponent, playerUpdate, speciesUpdateRate, structure, traitColor, traitName, trajectoryColor, VACANT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Providers of command line options may want to remove certain options that other providers provided by overriding this method.Opportunity to supply custom individual based simulations.Returns a string with information about the authors of the module.getKey()
Returns identifier of the active module.Type[]
Return array of Model types that this Module supports.int
Return the number of demes.int
Return the size of each demes.getTitle()
Returns title of active module, e.g.void
mixedScores
(int[] count, double[] traitScores) Calculate the average payoff/score in a finite population with the number of each trait/strategy provided incount
for pairwise interactions.Methods inherited from class TBT
avgScores, collectCLO, getDependent, getMaxGameScore, getMeanColors, getMinGameScore, getMonoGameScore, getPayoff, getPayoffs, getTraitName, load, pairScores, setPayoff, setPayoffs, unload
Methods inherited from class Discrete
add, getMaxMonoGameScore, getMinMonoGameScore, getMonoStop, getMutation, setMonoStop
Methods inherited from class Module
check, createGeometry, getActiveTraits, getCompetitionGeometry, getDeathRate, getGeometry, getIBSPopulation, getID, getInteractionGeometry, getMapToFitness, getMarkers, getNActive, getName, getNGroup, getNPopulation, getNRoles, getNSpecies, getNTraits, getOpponent, getPlayerUpdate, getSpecies, getSpecies, getSpeciesUpdateRate, getTraitColor, getTraitColors, getTraitNames, getTrajectoryColor, getVacant, init, isNeutral, processColorMap, reset, run, setActiveTraits, setDeathRate, setGeometries, setIBSPopulation, setModel, setName, setNGroup, setNPopulation, setNTraits, setOpponent, setSpeciesUpdateRate, setTraitColors, setTraitNames, setTrajectoryColor
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface Features.Pairs
isPairwise
Methods inherited from interface HasHistogram
getCustomLevels, getNTraits, getTraitColors
Methods inherited from interface IBS.HasIBS
createIBS
Methods inherited from interface MilestoneListener
modelDidInit, modelDidReset, modelLoaded, modelRelaxed, modelRunning, modelSettings, modelStopped, modelUnloaded, moduleLoaded, moduleRestored, moduleUnloaded
Methods inherited from interface ODE.HasODE
createODE
Methods inherited from interface PDE.HasPDE
createPDE
Methods inherited from interface SDE.HasSDE
createSDE
-
Field Details
-
nDemes
int nDemesThe number of demes. -
sizeDemes
int sizeDemesThe size of each deme.
-
-
Constructor Details
-
DemesTBT
Create a new instance of the DemesTBT module.- Parameters:
engine
- the pace maker of the simulation
-
-
Method Details
-
getModelTypes
Return array of Model types that this Module supports.Currently only IBS models are supported even though super supports more.
- Overrides:
getModelTypes
in classModule
- Returns:
- the array of supported Model types
-
getKey
Description copied from class:Module
Returns identifier of the active module. For example, 2x2 games inTBT
return "2x2". This corresponds to the argument for the--module
option to load a particular module. The default is to use the class name. -
getAuthors
Description copied from class:Module
Returns a string with information about the authors of the module.- Overrides:
getAuthors
in classTBT
- Returns:
- the names of the authors
-
getTitle
Description copied from class:Module
Returns title of active module, e.g. 2x2 games inTBT
returns "2x2 Games". -
mixedScores
public void mixedScores(int[] count, double[] traitScores) 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[])
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).- Specified by:
mixedScores
in interfaceIBS.HasIBS.DPairs
- Overrides:
mixedScores
in classTBT
- Parameters:
count
- number of individuals for each trait/strategytraitScores
- array for returning the payoffs/scores of each trait/strategy
-
adjustCLO
Description copied from interface:CLOProvider
Providers of command line options may want to remove certain options that other providers provided by overriding this method. After all command line options are collected, all providers get a chance to adjust the collection. In particular, options should be removed that do not make sense in present context. Overriding methods usually callCLOParser.removeCLO(String[])
or variants thereof.- Specified by:
adjustCLO
in interfaceCLOProvider
- Overrides:
adjustCLO
in classTBT
- Parameters:
parser
- the reference to parser that manages command line options- See Also:
-
getNDemes
public int getNDemes()Return the number of demes.- Returns:
- the number of demes
-
getSizeDemes
public int getSizeDemes()Return the size of each demes.- Returns:
- the size of one demes
-
createIBSPop
Description copied from class:Module
Opportunity to supply custom individual based simulations.- Overrides:
createIBSPop
in classTBT
- Returns:
- the custom IBSPopulation or
null
to use default.
-