Package org.evoludo.simulator.modules
Class TBT.IBSPop
Object
IBSPopulation
IBSDPopulation
IBSPop
- Direct Known Subclasses:
ATBT.ATBTPop
,DemesTBT.IBSPop
- Enclosing class:
TBT
The extension for IBS simulations specific to populations engaging in
2×2
games. This extension implements customizations for
Geometry.Type.SQUARE_NEUMANN_2ND
as well as specific initial
conditions that give rise to fascinating evolutionary kaleidoscopes for
deterministic updating.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) double
Timestamp for the last fitness calculation.(package private) double[]
The trait fitnesses for the two sublattices forGeometry.Type.SQUARE_NEUMANN_2ND
.(package private) double
Timestamp for the last mean trait calculation.(package private) double[]
The trait frequencies for the two sublattices forGeometry.Type.SQUARE_NEUMANN_2ND
.Fields inherited from class IBSDPopulation
accuTypeScores, groupmodule, init, initTypeCount, module, mutation, optimizeMoran, pairmodule, strategies, strategiesScratch, strategiesTypeCount
Fields inherited from class IBSPopulation
adjustScores, competition, compGroup, debugFocal, debugModel, debugModels, debugNModels, debugSame, distrMigrants, engine, fitness, groupScores, hasLookupTable, interaction, interactions, interGroup, isMultispecies, isNeutral, logger, map2fit, maxEffScoreIdx, maxFitness, maxScore, migrationType, minFitness, minScore, nMixedInter, nPopulation, nTraits, pAddwire, playerScoreAveraged, playerScoring, pMigration, pRewire, rng, scores, smallScores, staticmodule, sumFitness, tags, typeFitness, typeScores, VACANT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
check()
Check all model parameters for consistency and adjust if necessary (and feasible).void
getMeanFitness
(double[] mean) Returns the mean fitness of this population in the arraymean
.void
getMeanTraits
(double[] mean) Returns the mean trait(s) of this population in the arraymean
.int
getNMean()
Return the number of mean values for this population (for traits or fitness).Gets the status of the as a formatted string.getTraitNameAt
(int idx) Gets the formatted name of the trait of the individual at siteindex
.protected void
Initial configuration that generates evolutionary kaleidoscopes for deterministic update rules.Methods inherited from class IBSDPopulation
adjustGameScoresAt, adjustPairGameScoresAt, adjustScoreAt, adjustScoreAt, becomesVacantAt, checkConvergence, commitStrategies, commitStrategyAt, countTraits, debugMarkChange, doAdjustScores, encodeStrategies, getFitnessAt, getFitnessHistogramData, getInit, getInitialTraits, getMonoScore, getPopulationSize, getScoreAt, getStrategiesTypeCount, getTraitData, getTraits, haveSameStrategy, init, initFrequency, initMono, initMutant, initStripes, initTemperature, initUniform, isConsistent, isMonomorphic, isSameStrategy, isVacantAt, maybeMutateAt, maybeMutateMoran, mouseHitNode, mutateAt, playGroupGameAt, playPairGameAt, preferredPlayerBest, prepareStrategies, reset, resetScoreAt, resetScores, resetStrategies, restoreFitness, restoreStrategies, setInit, setInitialTraits, setOpponentPop, setScoreAt, stripGroupVacancies, stripVacancies, swapStrategies, updateFromModelAt, updateMixedMeanScores, updatePlayerBestResponse, updatePlayerEcologyAt, updatePlayerMoranBirthDeath, updatePlayerMoranDeathBirth, updatePlayerMoranDeathBirth, updatePlayerMoranImitate, updateScoreAt, updateScores, updateStrategiesTypeCount, yalpGroupGameAt
Methods inherited from class IBSPopulation
checkGeometry, createCompetitionGeometry, createInteractionGeometry, debugScores, debugUpdatePopulationAt, doBirthDeathMigration, doDeathBirthMigration, doDiffusionMigration, doMigration, doSyncMigration, encodeFitness, encodeGeometry, encodeInteractions, generateGeometry, getCompetitionGeometry, getCompGroup, getFitness, getFitnessData, getFitnessNameAt, getFitnessNameAt, getInteractionGeometry, getInteractionsAt, getInterGroup, getMaxScore, getMigrationProb, getMigrationType, getMinScore, getModule, getPlayerScoreAveraged, getPlayerScoring, getPopulationUpdate, getScoreNameAt, getScores, getSyncFraction, getTagAt, getTagData, getTagNameAt, getTags, getTotalFitness, migrateMoran, mouseHitNode, mutate, nextBinomial, parseGeometry, pickFitFocalIndividual, pickFitFocalIndividual, pickFitNeighborAt, pickFitNeighborAt, pickFocalIndividual, pickFocalIndividual, pickFocalSite, pickFocalSite, pickNeighborSiteAt, playGameAt, playGameSyncAt, processScore, random01, random01d, random0n, random0N, randomGaussian, removeScoreAt, removeScoreAt, restoreGeometry, restoreInteractions, setAddwire, setConsistencyCheck, setMaxEffScoreIdx, setMigrationProb, setMigrationType, setPlayerScoreAveraged, setPlayerScoring, setPopulationUpdate, setRewire, setSyncFraction, setTagAt, srandom, step, swapScoresAt, updateEffScoreRange, updateFitnessAt, updateMinMaxScores, updatePlayerAsync, updatePlayerAsyncAt, updatePlayerAt, updatePlayerBest, updatePlayerBestHalf, updatePlayerEcology, updatePlayerMoranBirthDeathAt, updatePlayerMoranDeathBirthAt, updatePlayerMoranImitateAt, updatePlayerSwap, updateProportionalAbs, updateReplicatorHalf, updateReplicatorPlus, updateScoreAt, updateScoreAt, updateThermal
-
Field Details
-
tsMean
double tsMeanTimestamp for the last mean trait calculation. -
tsFit
double tsFitTimestamp for the last fitness calculation. -
tsTraits
double[] tsTraitsThe trait frequencies for the two sublattices forGeometry.Type.SQUARE_NEUMANN_2ND
. -
tsFits
double[] tsFitsThe trait fitnesses for the two sublattices forGeometry.Type.SQUARE_NEUMANN_2ND
.
-
-
Constructor Details
-
IBSPop
Create a new instance of the IBS model for2×2
games.- Parameters:
engine
- the pacemaker for running the modelmodule
- the module that defines the game
-
-
Method Details
-
check
public boolean check()Description copied from class:IBSPopulation
Check all model parameters for consistency and adjust if necessary (and feasible). Returnstrue
if adjustments require a reset. Free memory if possible and request a reset if new memory needs to be allocated.- Overrides:
check
in classIBSDPopulation
- Returns:
true
if reset is required- See Also:
-
getTraitNameAt
Description copied from class:IBSPopulation
Gets the formatted name of the trait of the individual at siteindex
.- Overrides:
getTraitNameAt
in classIBSDPopulation
- Parameters:
idx
- the index of the- Returns:
- the string describing the trait
-
getNMean
public int getNMean()Description copied from class:IBSPopulation
Return the number of mean values for this population (for traits or fitness).Note: The number of mean traits in a model may differ from the number of traits in the corresponding module. This is the case for example for
Geometry.Type.SQUARE_NEUMANN_2ND
with two disjoint interaction or competition graphs.- Overrides:
getNMean
in classIBSPopulation
- Returns:
- the number of mean values
- See Also:
-
getMeanTraits
public void getMeanTraits(double[] mean) Description copied from class:IBSPopulation
Returns the mean trait(s) of this population in the arraymean
. Used by GUI to visualize the current state of this IBS model.- Overrides:
getMeanTraits
in classIBSDPopulation
- Parameters:
mean
- the array for returning the trait values- See Also:
-
getMeanFitness
public void getMeanFitness(double[] mean) Description copied from class:IBSPopulation
Returns the mean fitness of this population in the arraymean
. Used by GUI to visualize the current state of this IBS model. Returnstrue
if data point belongs to the same time series andfalse
if a new series was started throughIBSPopulation.init()
orIBSPopulation.reset()
.- Overrides:
getMeanFitness
in classIBSDPopulation
- Parameters:
mean
- the array for storing the mean fitness values- See Also:
-
getStatus
Description copied from class:IBSPopulation
Gets the status of the as a formatted string. This is typically used in the GUI to summarize the progress of the model.- Overrides:
getStatus
in classIBSDPopulation
- Returns:
- the status of the population
-
initKaleidoscope
protected void initKaleidoscope()Description copied from class:IBSDPopulation
Initial configuration that generates evolutionary kaleidoscopes for deterministic update rules. Whether this is possible and and what kind of initial configurations are required depends on the module. Hence this method must be overriden in subclasses that admit kaleidoscopes.Note: requires the explicit adding of the key
IBSD.Init.Type.KALEIDOSCOPE
for IBS models. For example, addif (model instanceof IBSD) { CLOption clo = ((IBSDPopulation) getIBSPopulation()).getInit().clo; clo.addKey(Init.Type.KALEIDOSCOPE); }
toorg.evoludo.simulator.modules.Module#adjustCLO(org.evoludo.util.CLOParser)
.- Overrides:
initKaleidoscope
in classIBSDPopulation
- See Also:
-