Package org.evoludo.simulator.models
Interface Continuous
- All Known Implementing Classes:
IBSC
public interface Continuous
Common interface for all models with continuous strategy sets.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
get2DTraitHistogramData
(int id, double[] bins, int trait1, int trait2) Gets the histogram of the trait distribution for the traits of theModule
.double
getMaxMonoScore
(int id) Calculates and returns maximum score in monomorphic population.double
getMinMonoScore
(int id) Calculates and returns minimum score in monomorphic population.void
getTraitHistogramData
(int id, double[][] bins) Gets the histogram of the trait distributions and returns the data in an arraybins
, where the first index denotes the trait (in case there are multiple) and the second index refers to the bins in the histogram.double[]
getTraitMax
(int id) Gets the maximum trait values in this module.double[]
getTraitMin
(int id) Gets the minimum trait values in this module.
-
Method Details
-
getTraitMin
double[] getTraitMin(int id) Gets the minimum trait values in this module.- Parameters:
id
- the id of the population for multi-species models- Returns:
- the array with the minimum trait values
-
getTraitMax
double[] getTraitMax(int id) Gets the maximum trait values in this module.- Parameters:
id
- the id of the population for multi-species models- Returns:
- the array with the maximum trait values
-
getMinMonoScore
double getMinMonoScore(int id) Calculates and returns minimum score in monomorphic population. This depends on the payoff accounting (averaged versus accumulated) as well as theGeometry
. Since modules are agnostic of runtime details, the request is simply forwarded to the currentModel
together with the species ID for multi-species modules.- Parameters:
id
- the id of the population for multi-species models- Returns:
- the minimum monomorphic score
-
getMaxMonoScore
double getMaxMonoScore(int id) Calculates and returns maximum score in monomorphic population. This depends on the payoff accounting (averaged versus accumulated) as well as theGeometry
. Since modules are agnostic of runtime details, the request is simply forwarded to the currentModel
together with the species ID for multi-species modules.- Parameters:
id
- the id of the population for multi-species models- Returns:
- the maximum monomorphic score
-
getTraitHistogramData
void getTraitHistogramData(int id, double[][] bins) Gets the histogram of the trait distributions and returns the data in an arraybins
, where the first index denotes the trait (in case there are multiple) and the second index refers to the bins in the histogram.This is a helper method to forward the request to the appropriate
IBSMCPopulation
(for multiple traits) orIBSCPopulation
(for single traits).- Parameters:
id
- the id of the population for multi-species modelsbins
- the 2D data array for storing the histogram
-
get2DTraitHistogramData
void get2DTraitHistogramData(int id, double[] bins, int trait1, int trait2) Gets the histogram of the trait distribution for the traits of theModule
. For modules with multiple traits a 2D histogram is generated for traitstrait1
andtrait2
. The histogram is returned in the linear arraybins
and arranged in a way that is compatible with square lattice geometries for visualization byDistribution
(GWT only). For modules with a single trait only,trait1
andtrait2
are ignored.- Parameters:
id
- the id of the population for multi-species modelsbins
- the data array for storing the histogramtrait1
- the index of the first trait (horizontal axis)trait2
- the index of the second trait (vertical axis)- See Also:
-