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) doubleTimestamp for the last fitness calculation.(package private) double[]The trait fitnesses for the two sublattices forGeometry.Type.SQUARE_NEUMANN_2ND.(package private) doubleTimestamp 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, active, groupmodule, init, initCount, module, mutation, opponent, optimizeMoran, pairmodule, traitsCount, traitsNextFields 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 TypeMethodDescriptionbooleancheck()Check all model parameters for consistency and adjust if necessary (and feasible).voidgetMeanFitness(double[] mean) Returns the mean fitness of this population in the arraymean.voidgetMeanTraits(double[] mean) Returns the mean trait(s) of this population in the arraymean.intgetNMean()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 voidInitial configuration that generates evolutionary kaleidoscopes for deterministic update rules.Methods inherited from class IBSDPopulation
adjustGameScoresAt, adjustPairGameScoresAt, adjustScoreAt, adjustScoreAt, becomesVacantAt, checkConvergence, commitTraitAt, commitTraits, countTraits, debugMarkChange, doAdjustScores, encodeTraits, getFitnessAt, getFitnessHistogramData, getInit, getInitialTraits, getMonoScore, getPopulationSize, getScoreAt, getTraitAt, getTraitData, getTraits, getTraitsCount, haveSameTrait, init, initFrequency, initMono, initMono, initMono, initMutant, initStripes, initTemperature, initUniform, isConsistent, isMonomorphic, isSameTrait, isVacantAt, maybeMutateAt, maybeMutateMoran, mouseHitNode, mutateAt, playGroupGameAt, playPairGameAt, preferredPlayerBest, prepareTraits, reset, resetScoreAt, resetScores, resetTraits, restoreFitness, restoreTraits, setInit, setInitialTraits, setNextTraitAt, setOpponentPop, setScoreAt, setTraitAt, stripGroupVacancies, stripVacancies, swapTraits, updateFromModelAt, updateMixedMeanScores, updatePlayerBestResponse, updatePlayerEcologyAt, updatePlayerMoranBirthDeath, updatePlayerMoranDeathBirth, updatePlayerMoranDeathBirth, updatePlayerMoranImitate, updateScoreAt, updateScores, updateTraitCount, yalpGroupGameAtMethods 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, getSpeciesUpdateRate, 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, 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×2games.- Parameters:
engine- the pacemaker for running the modelmodule- the module that defines the game
-
-
Method Details
-
check
public boolean check()Description copied from class:IBSPopulationCheck all model parameters for consistency and adjust if necessary (and feasible). Returnstrueif adjustments require a reset. Free memory if possible and request a reset if new memory needs to be allocated.- Overrides:
checkin classIBSDPopulation- Returns:
trueif reset is required- See Also:
-
getTraitNameAt
Description copied from class:IBSPopulationGets the formatted name of the trait of the individual at siteindex.- Overrides:
getTraitNameAtin classIBSDPopulation- Parameters:
idx- the index of the- Returns:
- the string describing the trait
-
getNMean
public int getNMean()Description copied from class:IBSPopulationReturn 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_2NDwith two disjoint interaction or competition graphs.- Overrides:
getNMeanin classIBSPopulation- Returns:
- the number of mean values
- See Also:
-
getMeanTraits
public void getMeanTraits(double[] mean) Description copied from class:IBSPopulationReturns the mean trait(s) of this population in the arraymean. Used by GUI to visualize the current state of this IBS model.- Overrides:
getMeanTraitsin classIBSDPopulation- Parameters:
mean- the array for returning the trait values- See Also:
-
getMeanFitness
public void getMeanFitness(double[] mean) Description copied from class:IBSPopulationReturns the mean fitness of this population in the arraymean. Used by GUI to visualize the current state of this IBS model. Returnstrueif data point belongs to the same time series andfalseif a new series was started throughIBSPopulation.init()orIBSPopulation.reset().- Overrides:
getMeanFitnessin classIBSDPopulation- Parameters:
mean- the array for storing the mean fitness values- See Also:
-
getStatus
Description copied from class:IBSPopulationGets the status of the as a formatted string. This is typically used in the GUI to summarize the progress of the model.- Overrides:
getStatusin classIBSDPopulation- Returns:
- the status of the population
-
initKaleidoscope
protected void initKaleidoscope()Description copied from class:IBSDPopulationInitial 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.KALEIDOSCOPEfor 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:
initKaleidoscopein classIBSDPopulation- See Also:
-