Package org.evoludo.simulator.models
Interface Discrete
- All Known Implementing Classes:
Advection
,ATBT.ODE
,IBSD
,LV.ODE
,LV.SDE
,ODE
,PDE
,RungeKutta
,SDE
,SIR.ODE
,SIR.PDE
,SIR.SDE
public interface Discrete
Common interface for all models with discrete sets of traits.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getInitialTraits
(double[] init) Collect and return initial trait values for all species.void
getInitialTraits
(int id, double[] init) Return initial trait values for species with IDid
.default double
getMonoScore
(int id, int idx) Calculate and return the payoff/score of individuals in monomorphic populations with traitidx
but also deals with payoff accounting (averaged versus accumulated).default boolean
setInitialTraits
(double[] init) Set initial traits in one or all species.default boolean
setInitialTraits
(int id, double[] init) Set initial trait values for species with IDid
.
-
Method Details
-
getMonoScore
default double getMonoScore(int id, int idx) Calculate and return the payoff/score of individuals in monomorphic populations with traitidx
but also deals with payoff accounting (averaged versus accumulated).- Parameters:
id
- the id of the population for multi-species modelsidx
- the index of the trait- Returns:
- payoff/score in monomorphic population with trait
idx
. ReturnsNaN
if scores ill defined - See Also:
-
setInitialTraits
default boolean setInitialTraits(double[] init) Set initial traits in one or all species.NOTE: this is a convenience method for multi-species modules to set inital states efficiently for interactions with GUI.
- Parameters:
init
- the array with the initial trait values- Returns:
true
if initial traits successfully set
-
getInitialTraits
void getInitialTraits(double[] init) Collect and return initial trait values for all species.NOTE: this is a convenience method for multi-species modules to retrieve states efficiently for further processing or visualization.
- Parameters:
init
- the array for storing the initial trait values
-
setInitialTraits
default boolean setInitialTraits(int id, double[] init) Set initial trait values for species with IDid
.- Parameters:
id
- the species identifierinit
- the array with the initial trait values- Returns:
true
if initial traits successfully set
-
getInitialTraits
void getInitialTraits(int id, double[] init) Return initial trait values for species with IDid
.- Parameters:
id
- the species identifierinit
- the array for storing the initial trait values
-