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 TypeMethodDescriptionvoidgetInitialTraits(double[] init) Collect and return initial trait values for all species.voidgetInitialTraits(int id, double[] init) Return initial trait values for species with IDid.default doublegetMonoScore(int id, int idx) Calculate and return the payoff/score of individuals in monomorphic populations with traitidxbut also deals with payoff accounting (averaged versus accumulated).default booleansetInitialTraits(double[] init) Set initial traits in one or all species.default booleansetInitialTraits(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 traitidxbut 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. ReturnsNaNif 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:
trueif 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:
trueif 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
-