Package org.evoludo.simulator.modules
Class SIR.PDE
- All Implemented Interfaces:
Discrete,CLOProvider
- Enclosing class:
SIR
PDE model for the SIR module.
-
Nested Class Summary
Nested classes/interfaces inherited from class PDE
PDE.InitTypeNested classes/interfaces inherited from class Model
Model.HasDE -
Field Summary
Fields inherited from class PDE
alpha, cloPdeDiffusion, cloPdeL, cloPdeN, cloPdeSymmetric, density, dependent, diffcoeff, discretization, fitness, initType, linext, maxDensity, maxFitness, meanDensity, meanFitness, minDensity, minFitness, module, next, space, supervisorFields inherited from class ODE
cloAdjustedDynamics, cloDEAccuracy, cloDEdt, cloInit, cloTimeReversed, isDensity, monoStopFields 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
ConstructorsConstructorDescriptionPDE()Constructor for the spatial SIR model based on partial differential equations. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgetDerivatives(double t, double[] state, double[] unused, double[] change) Calculate the rates of change for all species instateattimegiven the fitnessfitnessand returned inchange.Methods inherited from class PDE
check, collectCLO, diffuse, encodeFitness, encodeState, getDiffusion, getDiscretization, getFitnessData, getFitnessHistogramData, getFitnessNameAt, getGeometry, getLinearExtension, getMeanFitness, getMeanFitnessAt, getMeanTraitAt, getMeanTraits, getMeanTraits, getStatus, getSymmetric, getTraitData, getTraitNameAt, incrementTime, init, initDiffusion, isMonomorphic, isSymmetric, load, next, normalizeMeanDensity, normalizeMeanFitness, parse, permitsTimeReversal, react, reset, resetDensity, resetFitness, restoreFitness, restoreState, restoreTraits, setConverged, setDensity, setDiscretization, setLinearExtension, setSymmetric, unload, update, updateDensity, updateFitness, useSchedulingMethods inherited from class ODE
checkConvergence, deStep, getAccuracy, getDt, getInitialTraits, getInitialTraits, getMaxFitness, getMaxScore, getMeanFitness, getMinFitness, getMinScore, getMonoScore, getNMean, getNMean, isDensity, isTimeReversed, normalizeState, setAccuracy, setAdjustedDynamics, setDt, setInitialTraits, setInitialTraits, setTimeReversed, updateBest, updateBestResponse, updateEcology, updateImitate, updateImitateBetter, updateProportional, updateThermalMethods inherited from class Model
debugStep, getCounter, getFixationData, getLogger, getMeanName, getMeanNames, getMode, getNextHalt, getNSamples, getNSpecies, getNStatisticsFailed, getNStatisticsSamples, getScoreNameAt, getSpecies, getTime, getTimeRelax, getTimeStep, getTimeStop, getType, hasConverged, initStatisticsFailed, initStatisticsSample, isConnected, isContinuous, isRelaxing, permitsDebugStep, permitsMode, permitsSampleStatistics, permitsUpdateStatistics, readStatisticsSample, relax, requestMode, resetStatisticsSample, setMode, setNSamples, setTimeRelax, setTimeStep, setTimeStopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CLOProvider
adjustCLO
-
Constructor Details
-
PDE
public PDE()Constructor for the spatial SIR model based on partial differential equations.
-
-
Method Details
-
getDerivatives
protected void getDerivatives(double t, double[] state, double[] unused, double[] change) Description copied from class:ODECalculate the rates of change for all species instateattimegiven the fitnessfitnessand 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
synchronizedto 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:
getDerivativesin 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:
-