Package org.evoludo.simulator.modules
Class SIR.ODE
Object
Model
ODE
RungeKutta
ODE
- All Implemented Interfaces:
Discrete
,CLOProvider
- Enclosing class:
SIR
ODE model for the SIR module.
-
Nested Class Summary
Nested classes/interfaces inherited from class ODE
ODE.InitType
Nested classes/interfaces inherited from class Model
Model.HasDE
-
Field Summary
Fields inherited from class ODE
cloAdjustedDynamics, cloDEAccuracy, cloDEdt, cloInit, cloTimeReversed, initType, isDensity, 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
ConstructorsConstructorDescriptionODE()
Constructor for the classic SIR model based on ordinary differential equations. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
getDerivatives
(double t, double[] state, double[] unused, double[] change) Calculate the rates of change for all species instate
attime
given the fitnessfitness
and returned inchange
.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, permitsTimeReversal, 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, isRelaxing, 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
-
Constructor Details
-
ODE
public ODE()Constructor for the classic SIR model based on ordinary differential equations.
-
-
Method Details
-
getDerivatives
protected void getDerivatives(double t, double[] state, double[] unused, 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 populationunused
- 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:
-