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) double
The per capita death rate for the predator/prey population.(package private) final boolean
The flag to indicate whether this is a predator population.(package private) double
The maximum rate at which events can occur.(package private) IBSPop
The reference to the predator population.(package private) IBSPop
The 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, traitsNext
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).double
Gets the update rate of this species.boolean
setInitialTraits
(double[] init) Set the initial trait frequencies in the population.protected int
updatePlayerEcologyAt
(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, 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, 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==true
thenpredator==this
. -
prey
IBSPop preyThe reference to the prey population. IfisPredator==false
thenprey==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: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:
-
getSpeciesUpdateRate
public double getSpeciesUpdateRate()Description copied from class:IBSPopulation
Gets 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:
getSpeciesUpdateRate
in 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 siteA
of the peer species as well as one of the opponent speciesB
:- reproduction: occurs at rate
rates[0]
ifA
is empty; - death: spontaneous death occurs at rate
rates[0]
and death due to competition with peers occurs at raterates[2]
ifA
is occupied; - predation: prey gets eaten at rate
rates[1]
ifB
is occupied, while predators have a chance to reproduce, providedA
is empty.
- Overrides:
updatePlayerEcologyAt
in 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:IBSDPopulation
Set the initial trait frequencies in the population. Switches the initialization type toIBSD.Init.Type.FREQUENCY
.- Overrides:
setInitialTraits
in classIBSDPopulation
- Parameters:
init
- the initial traits- Returns:
true
if the initialization was successful
-