Class Predator
- All Implemented Interfaces:
Runnable, LifecycleListener, Model.HasDE, RunListener, Features, Features.Multispecies, CLOProvider
Predator class representing the predator species in the Lotka-Volterra model.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Features
Features.Groups, Features.Multispecies, Features.Pairs, Features.Payoffs, Features.StaticNested classes/interfaces inherited from interface Model.HasDE
Model.HasDE.DGroups, Model.HasDE.DPairs, Model.HasDE.DualDynamics, Model.HasDE.EM, Model.HasDE.ODE, Model.HasDE.PDE, Model.HasDE.PDEADV, Model.HasDE.PDERD, Model.HasDE.RK5, Model.HasDE.SDE -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intThe index of the predator.(package private) LVThe reference to the prey species.(package private) double[]The reaction rates for predator reproduction, predation, and competition.Fields inherited from class Discrete
cloMonoStop, monoStop, mutationFields inherited from class Module
active, birthRate, cloBirthRate, cloCompRate, cloDeathRate, cloGeometry, cloModel, cloNGroup, cloNPopulation, cloPhase2DAxes, cloTraitColors, cloTraitDisable, cloTraitNames, competitionRate, competitionRates, deathRate, defaultColor, engine, ibspop, id, logger, map2fitness, model, nActive, name, nGroup, nPopulation, nTraits, opponent, playerUpdate, species, structure, traitColor, traitName, trajectoryColor, VACANT_COLOR, VACANT_NAME, vacantIdx -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOpportunity to supply custom individual based simulations.intFor replicator dynamics the frequencies of all traits must sum up to one.voidload()Load new module and perform basic initializations.Methods inherited from class Discrete
collectCLO, createModel, getMaxMonoPayoff, getMinMonoPayoff, getMonoPayoff, getMonoStop, getMutation, setMonoStop, unloadMethods inherited from class Module
add, check, getActiveTraits, getAuthors, getBirthRate, getCompetitionRate, getCompetitionRates, getDeathRate, getGeometry, getIBSPopulation, getId, getKey, getMap2Fitness, getMeanColors, getModelType, getModelTypes, getNActive, getName, getNGroup, getNPopulation, getNRoles, getNSpecies, getNTraits, getOpponent, getPlayerUpdate, getSpecies, getSpecies, getTraitColor, getTraitColors, getTraitName, getTraitNames, getTrajectoryColor, getVacantIdx, hasVacant, init, preprocessModelOption, processColorMap, reset, run, setActiveTraits, setBirthRate, setCompetitionRates, setDeathRate, setIBSPopulation, setModel, setName, setNGroup, setNPopulation, setNTraits, setNTraits, setOpponent, setTraitColors, setTraitNames, setTrajectoryColorMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CLOProvider
adjustCLOMethods inherited from interface Features
isPairwise, isStaticMethods inherited from interface Features.Multispecies
getTitle, isMultispeciesMethods inherited from interface LifecycleListener
modelLoaded, modelUnloaded, moduleLoaded, moduleRestored, moduleUnloadedMethods inherited from interface RunListener
modelDidInit, modelDidReset, modelRelaxed, modelRunning, modelSettings, modelStopped
-
Field Details
-
PREDATOR
static final int PREDATORThe index of the predator.- See Also:
-
prey
LV preyThe reference to the prey species. -
rates
double[] ratesThe reaction rates for predator reproduction, predation, and competition.
-
-
Constructor Details
-
Predator
Create a new instance of the phage population.- Parameters:
prey- the reference to the prey species
-
-
Method Details
-
load
-
getDependent
public int getDependent()Description copied from interface:Model.HasDEFor replicator dynamics the frequencies of all traits must sum up to one. Hence, fornTraitstraits there are onlynTraits-1degrees of freedom. The index returned bygetDependent()marks the one rate of change that is derived from all the others.Notes:
- Dependent traits are used by models where the frequencies of all types must sum up to one.
- Density modules do not have dependent traits and
getDependent()should return-1. - Currently differential equations implementations are only provided for Discrete modules.
- Specified by:
getDependentin interfaceModel.HasDE- Returns:
- the index of the dependent trait (or
-1if there is none)
-
createIBSPopulation
Description copied from class:ModuleOpportunity to supply custom individual based simulations.- Overrides:
createIBSPopulationin classModule<Discrete>- Returns:
- the custom IBSPopulation or
nullto use default.
-