Package org.evoludo.simulator.modules
Class IBSPop
Object
IBSPopulation
IBSDPopulation
IBSPop
Individual based simulation implementation of the Lotka-Volterra model.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) doubleThe per capita death rate for the predator/prey population.(package private) final booleanThe flag to indicate whether this is a predator population.(package private) doubleThe maximum rate at which events can occur.(package private) IBSPopThe reference to the predator population.(package private) IBSPopThe reference to the prey population.(package private) double[]The reaction rates for the predator/prey population.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).doubleGets the update rate of this species.booleansetInitialTraits(double[] init) Set the initial trait frequencies in the population.protected intupdatePlayerEcologyAt(int me) Individual based simulation implementation of the classical Lotka-Volterra model in finite and structured populations.Methods inherited from class IBSDPopulation
adjustGameScoresAt, adjustPairGameScoresAt, adjustScoreAt, adjustScoreAt, becomesVacantAt, checkConvergence, commitTraitAt, commitTraits, countTraits, debugMarkChange, doAdjustScores, encodeTraits, getFitnessAt, getFitnessHistogramData, getInit, getInitialTraits, getMeanFitness, getMeanTraits, getMonoScore, getPopulationSize, getScoreAt, getStatus, getTraitAt, getTraitData, getTraitNameAt, getTraits, getTraitsCount, haveSameTrait, init, initFrequency, initKaleidoscope, 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, setNextTraitAt, setOpponentPop, setScoreAt, setTraitAt, stripGroupVacancies, stripVacancies, swapTraits, updateFromModelAt, updateMixedMeanScores, updatePlayerBestResponse, 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, getNMean, 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, updatePlayerAt, updatePlayerBest, updatePlayerBestHalf, updatePlayerEcology, updatePlayerMoranBirthDeathAt, updatePlayerMoranDeathBirthAt, updatePlayerMoranImitateAt, updatePlayerSwap, updateProportionalAbs, updateReplicatorHalf, updateReplicatorPlus, updateScoreAt, updateScoreAt, updateThermal
-
Field Details
-
predator
IBSPop predatorThe reference to the predator population. IfisPredator==truethenpredator==this. -
prey
IBSPop preyThe reference to the prey population. IfisPredator==falsethenprey==this. -
isPredator
final boolean isPredatorThe flag to indicate whether this is a predator population. Convenience variable. -
rates
double[] ratesThe reaction rates for the predator/prey population. Convenience variable. -
deathRate
double deathRateThe per capita death rate for the predator/prey population. Convenience variable. -
maxRate
double maxRateThe maximum rate at which events can occur. This is used to convert rates into transition probabilities.
-
-
Constructor Details
-
IBSPop
Create a new custom implementation for IBS simulations.- Parameters:
engine- the pacemaker for running the modelmodule- the reference to the module implementing the model
-
-
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:
-
getSpeciesUpdateRate
public double getSpeciesUpdateRate()Description copied from class:IBSPopulationGets the update rate of this species. Only used in multi-species modules. Determines the relative rate at which this species is picked as compared to others.- Overrides:
getSpeciesUpdateRatein classIBSPopulation- Returns:
- the species update rate
- See Also:
-
updatePlayerEcologyAt
protected int updatePlayerEcologyAt(int me) Individual based simulation implementation of the classical Lotka-Volterra model in finite and structured populations. For a focal individual three events are possible based on the occupancy of a randomly selected neighbouring siteAof the peer species as well as one of the opponent speciesB:- reproduction: occurs at rate
rates[0]ifAis empty; - death: spontaneous death occurs at rate
rates[0]and death due to competition with peers occurs at raterates[2]ifAis occupied; - predation: prey gets eaten at rate
rates[1]ifBis occupied, while predators have a chance to reproduce, providedAis empty.
- Overrides:
updatePlayerEcologyAtin classIBSDPopulation- Parameters:
me- the index of the focal site- Returns:
- the number of elapsed realtime units
- See Also:
- reproduction: occurs at rate
-
setInitialTraits
public boolean setInitialTraits(double[] init) Description copied from class:IBSDPopulationSet the initial trait frequencies in the population. Switches the initialization type toIBSD.Init.Type.FREQUENCY.- Overrides:
setInitialTraitsin classIBSDPopulation- Parameters:
init- the initial traits- Returns:
trueif the initialization was successful
-