Package org.evoludo.simulator.modules
Class ATBT.ODE
Object
Model
ODE
RungeKutta
ODE
- All Implemented Interfaces:
Discrete
,CLOProvider
- Enclosing class:
ATBT
Provide ODE implementation for asymmetric
2×2
games with
environmental feedback.-
Nested Class Summary
Nested classes/interfaces inherited from class ODE
ODE.HasDE, ODE.HasODE, ODE.InitType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Module
Convenience variable: module associated with this model (useful for single species).Fields inherited from class ODE
cloAdjustedDynamics, cloDEAccuracy, cloDEdt, cloInit, cloTimeReversed, initType, monoStop
Fields inherited from class Model
cloSamples, cloTimeRelax, cloTimeStep, cloTimeStop, connect, converged, engine, fixData, isMultispecies, logger, mode, nSamples, nSpecies, nStatisticsFailed, nStatisticsSamples, rng, species, statisticsSampleNew, time, timeRelax, timeStep, timeStop
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
getDerivatives
(double t, double[] state, double[] fitness, double[] change) Calculate the rates of change for all species instate
attime
given the fitnessfitness
and returned inchange
.boolean
Checks if time reversal is permitted.Methods inherited from class ODE
checkConvergence, collectCLO, encodeState, getAccuracy, getDt, getFitnessData, getFitnessHistogramData, getInitialTraits, getInitialTraits, getMaxFitness, getMaxScore, getMeanFitness, getMeanFitness, getMeanTraits, getMeanTraits, getMinFitness, getMinScore, getMonoScore, getNMean, getNMean, getStatus, getTraitData, init, isDensity, isMonomorphic, isTimeReversed, load, next, normalizeState, parse, restoreState, setAccuracy, setAdjustedDynamics, setDt, setInitialTraits, setInitialTraits, setTimeReversed, update, updateBest, updateBestResponse, updateEcology, updateImitate, updateImitateBetter, updateProportional, updateThermal
Methods inherited from class Model
debugStep, getCounter, getFitnessNameAt, getFixationData, getLogger, getMeanFitnessAt, getMeanName, getMeanNames, getMeanTraitAt, getMode, getNextHalt, getNSamples, getNSpecies, getNStatisticsFailed, getNStatisticsSamples, getScoreNameAt, getSpecies, getTime, getTimeRelax, getTimeStep, getTimeStop, getTraitNameAt, getType, hasConverged, initStatisticsFailed, initStatisticsSample, isConnected, isContinuous, isDE, isIBS, isODE, isPDE, isRelaxing, isSDE, isType, permitsDebugStep, permitsMode, permitsSampleStatistics, permitsUpdateStatistics, readStatisticsSample, relax, requestMode, resetStatisticsSample, setMode, setNSamples, setTimeRelax, setTimeStep, setTimeStop, useScheduling
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface CLOProvider
adjustCLO
-
Field Details
-
module
Convenience variable: module associated with this model (useful for single species).
-
-
Constructor Details
-
ODE
Constructs a new ODE solver taylored for the integration of asymmetric2×2
games with environmental feedback.- Parameters:
engine
- the pacemaker for running the model
-
-
Method Details
-
permitsTimeReversal
public boolean permitsTimeReversal()Checks if time reversal is permitted. By default returnsfalse
. Only few models are capable of time reversal.ODE and SDE models return
true
by default.Ecological feedback is unable to deal with time reversal.
- Overrides:
permitsTimeReversal
in classODE
- Returns:
true
if time reversal permissible.- See Also:
-
getDerivatives
protected void getDerivatives(double t, double[] state, double[] fitness, double[] change) Description copied from class:ODE
Calculate the rates of change for all species instate
attime
given the fitnessfitness
and returned inchange
. For replicator models the dynamics depends on the selected type of player updating, seePlayerUpdate.Type
, while for modules with variable population sizes (density based or with vaccant 'space' (reproductive opportunities)) the fitness denotes the rate of reproduction moderated by the available 'space'.IMPORTANT: parallel processing for PDE's in JRE requires this method to be thread safe.
Note: adding
synchronized
to this method would seem to make sense but this results in a deadlock for multiple threads in PDE's and JRE. However, apparently not needed as javascript and java yield the exact same results (after 15k generations!)- Overrides:
getDerivatives
in classODE
- Parameters:
t
- the time at which to calculate the derivativestate
- the array of frequencies/densities denoting the state populationfitness
- the array of fitness values of types in populationchange
- the array to return the rate of change of each type in the population- See Also:
-