Package org.evoludo.simulator.modules
Class Predator
- All Implemented Interfaces:
Runnable
,MilestoneListener
,Model.HasDE
,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.Static
Nested 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 TypeFieldDescriptionfinal CLOption
Command line option to set the predator parameters.(package private) static final int
The index of the predator.(package private) LV
The reference to the prey species.(package private) double[]
The reaction rates for predator reproduction, predation, and competition.Fields inherited from class Discrete
cloMonoStop, monoStop, mutation, species
Fields inherited from class Module
active, cloDeathRate, cloGeometry, cloNGroup, cloNPopulation, cloPhase2DAxes, cloTraitColors, cloTraitDisable, cloTraitNames, competition, deathRate, defaultColor, engine, ibs, ID, interaction, logger, map2fitness, markers, model, nActive, name, nGroup, nPopulation, nTraits, opponent, playerUpdate, structure, traitColor, traitName, trajectoryColor, VACANT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
collectCLO
(CLOParser parser) All providers of command line options must implement this method to collect their options.Opportunity to supply custom individual based simulations.int
For replicator dynamics the frequencies of all traits must sum up to one.Methods inherited from class Discrete
add, getMaxMonoPayoff, getMinMonoPayoff, getMonoPayoff, getMonoStop, getMutation, load, setMonoStop, unload
Methods inherited from class Module
check, createGeometry, createModel, getActiveTraits, getAuthors, getCompetitionGeometry, getDeathRate, getGeometry, getIBSPopulation, getID, getInteractionGeometry, getKey, getMap2Fitness, getMarkers, getMeanColors, getModelTypes, getNActive, getName, getNGroup, getNPopulation, getNRoles, getNSpecies, getNTraits, getOpponent, getPlayerUpdate, getSpecies, getSpecies, getTraitColor, getTraitColors, getTraitName, getTraitNames, getTrajectoryColor, getVacant, init, processColorMap, reset, run, setActiveTraits, setDeathRate, setGeometries, setIBSPopulation, setModel, setName, setNGroup, setNPopulation, setNTraits, setOpponent, setTraitColors, setTraitNames, setTrajectoryColor
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface CLOProvider
adjustCLO
Methods inherited from interface Features
isPairwise, isStatic
Methods inherited from interface Features.Multispecies
getTitle, isMultispecies
Methods inherited from interface MilestoneListener
modelDidInit, modelDidReset, modelLoaded, modelRelaxed, modelRunning, modelSettings, modelStopped, modelUnloaded, moduleLoaded, moduleRestored, moduleUnloaded
-
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. -
cloPredator
Command line option to set the predator parameters.
-
-
Constructor Details
-
Predator
Create a new instance of the phage population.- Parameters:
prey
- the reference to the prey species
-
-
Method Details
-
getDependent
public int getDependent()Description copied from interface:Model.HasDE
For replicator dynamics the frequencies of all traits must sum up to one. Hence, fornTraits
traits there are onlynTraits-1
degrees 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:
getDependent
in interfaceModel.HasDE
- Returns:
- the index of the dependent trait (or
-1
if there is none)
-
collectCLO
Description copied from interface:CLOProvider
All providers of command line options must implement this method to collect their options.Each command line option is (uniquely) identified by it's name (see
CLOption.getName()
), which corresponds to the long version of the option. If an attempt is made to add an option with a name that already exists, theparser
issues a warning and ignores the option. Thus, in general, implementing subclasses should first register their options and callsuper.collectCLO(CLOParser)
at the end such that subclasses are able to override command line options specified in a parental class.Override this method in subclasses to add further command line options. Subclasses must make sure that they include a call to super.
- Specified by:
collectCLO
in interfaceCLOProvider
- Overrides:
collectCLO
in classDiscrete
- Parameters:
parser
- the reference to parser that manages command line options- See Also:
-
createIBSPop
Description copied from class:Module
Opportunity to supply custom individual based simulations.- Overrides:
createIBSPop
in classModule
- Returns:
- the custom IBSPopulation or
null
to use default.
-