Package org.evoludo.simulator.models
Interface ODE.HasDE
- All Known Subinterfaces:
ODE.HasODE
,PDE.HasPDE
,SDE.HasSDE
- All Known Implementing Classes:
ATBT
,CDL
,CDLP
,CDLPQ
,DemesTBT
,EcoPGG
,Moran
,RSP
,simCDL
,simCDLP
,simCDLPQ
,simMoran
,simTBT
,simTraits
,TBT
,Traits
- Enclosing class:
ODE
public static interface ODE.HasDE
Methods that every
Module
must implement, which advertises numerical
solutions based on differential equations.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
avgScores
(double[] density, int n, double[] avgscores) Calculate the average payoff/score for the frequency of traits/strategies specified in the arraydensity
for interactions in groups of sizen
.default void
avgScores
(double[] density, int n, double[] avgscores, int skip) Calculate the average payoff/score for the frequency of traits/strategies specified in the arraydensity
for interactions in groups of sizen
in multi-species interactions.default int
For replicator dynamics the frequencies of all strategies must sum up to one.
-
Method Details
-
getDependent
default int getDependent()For replicator dynamics the frequencies of all strategies must sum up to one. Hence, fornTraits
strategies there are onlynTraits-1
degrees of freedom.dependentTrait
marks the one that is derived from the others.- Returns:
- the index of the dependent trait or -1 if there is none
-
avgScores
default void avgScores(double[] density, int n, double[] avgscores) Calculate the average payoff/score for the frequency of traits/strategies specified in the arraydensity
for interactions in groups of sizen
. The average payoffs/scores for each of thenTraits
traits/strategies must be stored and returned in the arrayavgscores
.Note: needs to be thread safe for parallel processing of PDE's.
IMPORTANT: one of
should be implemented in modules that advertise the model typesODE, SDE
orPDE
.Alternatively, the method
ODE.getDerivatives(double, double[], double[], double[])
may be overridden in a subclass ofODE
, which may prevent calls toavgScores(...)
altogether.- Parameters:
density
- the frequency/density of each trait/strategyn
- the size of interaction groupsavgscores
- the array for storing the average payoffs/scores for each strategic type
-
avgScores
default void avgScores(double[] density, int n, double[] avgscores, int skip) Calculate the average payoff/score for the frequency of traits/strategies specified in the arraydensity
for interactions in groups of sizen
in multi-species interactions. The state of the current species starts at indexskip
and the average payoffs/scores for each of itsnTraits
traits/strategies must be stored and returned in the arrayavgscores
starting at indexskip
.Note: needs to be thread safe for parallel processing of PDE's.
IMPORTANT: one of
should be implemented in modules that advertise the model typesODE, SDE
orPDE
.Alternatively, the method
ODE.getDerivatives(double, double[], double[], double[])
may be overridden in a subclass ofODE
, which may prevent calls toavgScores(...)
altogether.- Parameters:
density
- the frequency/density of each trait/strategyn
- the size of interaction groupsavgscores
- the array for storing the average payoffs/scores for each strategic typeskip
- the entries to skip in arraysdensity
andavgscores
-