Package org.evoludo.simulator.modules
Class DemesTBT
- All Implemented Interfaces:
Runnable,IBS.HasIBS,IBS.HasIBS.DPairs,MilestoneListener,Model.HasDE,Model.HasDE.DPairs,Model.HasDE.EM,Model.HasDE.ODE,Model.HasDE.PDE,Model.HasDE.PDEADV,Model.HasDE.PDERD,Model.HasDE.RK5,Model.HasDE.SDE,Features,Features.Pairs,Features.Payoffs,HasHistogram,HasHistogram.Degree,HasHistogram.Fitness,HasHistogram.StatisticsProbability,HasHistogram.StatisticsStationary,HasHistogram.StatisticsTime,HasMean,HasMean.Fitness,HasMean.Traits,HasPop2D,HasPop2D.Fitness,HasPop2D.Traits,HasPop3D,HasPop3D.Fitness,HasPop3D.Traits,CLOProvider
Simulations of 2x2 games in deme structured populations.
- Author:
- Christoph Hauert
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassCustom implemenation for individual based simulations in deme structured populations.Nested classes/interfaces inherited from interface Features
Features.Groups, Features.Multispecies, Features.Pairs, Features.Payoffs, Features.StaticNested classes/interfaces inherited from interface HasHistogram
HasHistogram.Degree, HasHistogram.Fitness, HasHistogram.StatisticsProbability, HasHistogram.StatisticsStationary, HasHistogram.StatisticsTime, HasHistogram.StrategyNested classes/interfaces inherited from interface HasMean
HasMean.Fitness, HasMean.TraitsNested classes/interfaces inherited from interface HasPop2D
HasPop2D.Fitness, HasPop2D.TraitsNested classes/interfaces inherited from interface HasPop3D
HasPop3D.Fitness, HasPop3D.TraitsNested classes/interfaces inherited from interface IBS.HasIBS
IBS.HasIBS.CGroups, IBS.HasIBS.CPairs, IBS.HasIBS.DGroups, IBS.HasIBS.DPairs, IBS.HasIBS.MCGroups, IBS.HasIBS.MCPairsNested classes/interfaces inherited from interface Model.HasDE
Model.HasDE.DGroups, Model.HasDE.DPairs, Model.HasDE.DualDynamics, Model.HasDE.EM, Model.HasDE.ODE, Model.HasDE.PDE, Model.HasDE.PDEADV, Model.HasDE.PDERD, Model.HasDE.RK5, Model.HasDE.SDE -
Field Summary
FieldsModifier and TypeFieldDescription(package private) intThe number of demes.(package private) intThe size of each deme.Fields inherited from class TBT
cloPayoffs, COOPERATE, DEFECT, payoffsFields inherited from class Discrete
cloMonoStop, monoStop, mutation, speciesFields inherited from class Module
active, cloDeathRate, cloGeometry, cloNGroup, cloNPopulation, cloPhase2DAxes, cloTraitColors, cloTraitDisable, cloTraitNames, competition, deathRate, defaultColor, engine, ibs, ID, interaction, logger, map2fitness, markers, model, nActive, name, nGroup, nPopulation, nTraits, opponent, playerUpdate, structure, traitColor, traitName, trajectoryColor, VACANT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidProviders 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.intReturn the number of demes.intReturn the size of each demes.getTitle()Returns title of active module, e.g.voidmixedScores(int[] count, double[] traitScores) Calculate the average payoff/score in a finite population with the number of each trait provided incountfor pairwise interactions.Methods inherited from class TBT
avgScores, collectCLO, getDependent, getMaxPayoff, getMeanColors, getMinPayoff, getMonoPayoff, getPayoff, getPayoffs, getTraitName, load, pairScores, setPayoff, setPayoffs, unloadMethods inherited from class Discrete
add, getMaxMonoPayoff, getMinMonoPayoff, getMonoStop, getMutation, setMonoStopMethods inherited from class Module
check, createGeometry, createModel, getActiveTraits, getCompetitionGeometry, getDeathRate, getGeometry, getIBSPopulation, getID, getInteractionGeometry, getMap2Fitness, getMarkers, getNActive, getName, getNGroup, getNPopulation, getNRoles, getNSpecies, getNTraits, getOpponent, getPlayerUpdate, getSpecies, getSpecies, getTraitColor, getTraitColors, getTraitNames, getTrajectoryColor, getVacant, init, processColorMap, reset, run, setActiveTraits, setDeathRate, setGeometries, setIBSPopulation, setModel, setName, setNGroup, setNPopulation, setNTraits, setOpponent, setTraitColors, setTraitNames, setTrajectoryColorMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Features
isMultispecies, isStaticMethods inherited from interface Features.Pairs
isPairwiseMethods inherited from interface Features.Payoffs
getMap2Fitness, getMaxMonoPayoff, getMinMonoPayoff, isNeutralMethods inherited from interface HasHistogram
getCustomLevels, getNTraits, getTraitColorsMethods inherited from interface IBS.HasIBS
createIBSMethods inherited from interface MilestoneListener
modelDidInit, modelDidReset, modelLoaded, modelRelaxed, modelRunning, modelSettings, modelStopped, modelUnloaded, moduleLoaded, moduleRestored, moduleUnloaded
-
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:
getModelTypesin classModule- Returns:
- the array of supported Model types
-
getKey
Description copied from class:ModuleReturns identifier of the active module. For example, 2x2 games inTBTreturn "2x2". This corresponds to the argument for the--moduleoption to load a particular module. The default is to use the class name. -
getAuthors
Description copied from class:ModuleReturns a string with information about the authors of the module.- Overrides:
getAuthorsin classTBT- Returns:
- the names of the authors
-
getTitle
Description copied from interface:FeaturesReturns title of active module, e.g. 2x2 games inTBTreturns "2x2 Games". -
mixedScores
public void mixedScores(int[] count, double[] traitScores) Description copied from interface:IBS.HasIBS.DPairsCalculate 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
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()(seeCXPopulationfor an example).- Specified by:
mixedScoresin interfaceIBS.HasIBS.DPairs- Overrides:
mixedScoresin classTBT- Parameters:
count- number of individuals for each traittraitScores- array for returning the payoffs/scores of each trait
-
adjustCLO
Description copied from interface:CLOProviderProviders 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:
adjustCLOin interfaceCLOProvider- Overrides:
adjustCLOin 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:ModuleOpportunity to supply custom individual based simulations.- Overrides:
createIBSPopin classTBT- Returns:
- the custom IBSPopulation or
nullto use default.
-