Class TBT.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
GeometryType.SQUARE_NEUMANN_2ND as well as specific initial
conditions that give rise to fascinating evolutionary kaleidoscopes for
deterministic updating.- Author:
- Christoph Hauert
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) doubleTimestamp for the last fitness calculation.(package private) double[]The trait fitnesses for the two sublattices forGeometryType.SQUARE_NEUMANN_2ND.(package private) doubleTimestamp for the last mean trait calculation.(package private) double[]The trait frequencies for the two sublattices forGeometryType.SQUARE_NEUMANN_2ND.Fields inherited from class IBSDPopulation
accuTypeScores, active, groupmodule, init, initCount, 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, module, mutation, nMixedInter, nPopulation, nTraits, opponent, optimizeHomo, pAddwire, playerScoreAveraged, playerScoring, pMigration, pRewire, rng, scores, smallScores, staticmodule, sumFitness, tags, typeFitness, typeScores, vacantIdx -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck()Check all model parameters for consistency and adjust if necessary (and feasible).double[]getMeanFitness(double[] mean) Returns the mean fitness of this population in the arraymean.double[]getMeanTraits(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.private voidInitialize kaleidoscope on cubic lattice.private voidinitCubeKaleidoscopeCinD(int l, int lz) Initialize kaleidoscope on cubic lattice with cooperators in center.private voidinitCubeKaleidoscopeDinC(int l, int lz) Initialize kaleidoscope on cubic lattice with defectors in center.protected voidInitial configuration that generates evolutionary kaleidoscopes for deterministic update rules.Methods inherited from class IBSDPopulation
adjustGameScoresAt, adjustPairGameScoresAt, adjustScoreAt, adjustScoreAt, becomesVacantAt, checkConsistentFitness, 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, optimizeMoran2Traits, optimizeMoranNTraits, playGroupGameAt, playPairGameAt, preferredPlayerBest, prepareTraits, reset, resetScoreAt, resetScores, resetTraits, restoreFitness, restoreTraits, setInit, setInitialTraits, setNextTraitAt, setOpponentPop, setScoreAt, setTraitAt, stripGroupVacancies, stripVacancies, swapTraits, updateFromModelAt, updateMixedScores, updatePlayerBestResponse, updatePlayerEcologyAt, updatePlayerMoranBirthDeath, updatePlayerMoranDeathBirth, updatePlayerMoranDeathBirth, updatePlayerMoranImitate, updateScoreAt, updateScores, updateTraitCount, yalpGroupGameAtMethods inherited from class IBSPopulation
debugScores, debugUpdate, debugUpdatePopulationAt, doBirthDeathMigration, doDeathBirthMigration, doDiffusionMigration, doMigration, doSyncMigration, encodeFitness, encodeGeometry, encodeInteractions, 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, pickFitFocalIndividual, pickFitFocalIndividual, pickFitNeighborAt, pickFitNeighborAt, pickFocalIndividual, pickFocalIndividual, pickFocalSite, pickFocalSite, pickNeighborSiteAt, playGameAt, playGameSyncAt, processScore, random01, random0n, randomGaussian, removeScoreAt, removeScoreAt, restoreGeometry, restoreInteractions, setAddwire, setConsistencyCheck, setMaxEffScoreIdx, setMigrationProb, setMigrationType, setPlayerScoreAveraged, setPlayerScoring, setPopulationUpdate, setRewire, setSyncFraction, setTagAt, 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 forGeometryType.SQUARE_NEUMANN_2ND. -
tsFits
double[] tsFitsThe trait fitnesses for the two sublattices forGeometryType.SQUARE_NEUMANN_2ND.
-
-
Constructor Details
-
IBSPop
-
-
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
GeometryType.SQUARE_NEUMANN_2NDwith two disjoint interaction or competition graphs.- Overrides:
getNMeanin classIBSPopulation<Discrete, IBSDPopulation>- Returns:
- the number of mean values
- See Also:
-
getMeanTraits
public double[] 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- Returns:
- the array
meancontaining the mean trait values - See Also:
-
getMeanFitness
public double[] 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- Returns:
- the array
meancontaining 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:
-
initCubeKaleidoscope
private void initCubeKaleidoscope()Initialize kaleidoscope on cubic lattice. -
initCubeKaleidoscopeDinC
private void initCubeKaleidoscopeDinC(int l, int lz) Initialize kaleidoscope on cubic lattice with defectors in center. If the population size is25'000then the NOVA settings are used (a cube with dimensions50×50×10).- Parameters:
l- the linear dimension of the cubelz- the linear dimension of the z-dimension
-
initCubeKaleidoscopeCinD
private void initCubeKaleidoscopeCinD(int l, int lz) Initialize kaleidoscope on cubic lattice with cooperators in center. If the population size is25'000then the NOVA settings are used (a cube with dimensions50×50×10).- Parameters:
l- the linear dimension of the cubelz- the linear dimension of the cube in the z-dimension
-