Class IBSC
- All Implemented Interfaces:
Continuous
,CLOProvider
IBS
parent.- Author:
- Christoph Hauert
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The initialization of populations with continuous traits.Nested classes/interfaces inherited from class IBS
IBS.Event, IBS.HasIBS, IBS.MigrationType, IBS.ScoringType, IBS.Statistics
-
Field Summary
Fields inherited from class IBS
cloAccumulatedScores, cloConsistency, cloGeometryAddwire, cloGeometryCompetition, cloGeometryInteraction, cloGeometryRewire, cloInteractions, cloMigration, cloReferences, cloScoringType, debugFocalSpecies, distrMutation, ephrng, isSynchronous, optimizeHomo, population, realtime, speciesUpdate, statisticsSettings
Fields inherited from class Model
cloSamples, cloTimeRelax, cloTimeStep, cloTimeStop, connect, converged, engine, fixData, isMultispecies, isRelaxing, logger, mode, nSamples, nSpecies, nStatisticsFailed, nStatisticsSamples, rng, species, statisticsSampleNew, time, timeRelax, timeStep, timeStop, type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
collectCLO
(CLOParser parser) All providers of command line options must implement this method to collect their options.void
get2DTraitHistogramData
(int id, double[] bins, int trait1, int trait2) Gets the histogram of the trait distribution for the traits of theModule
.(package private) IBSMCPopulation
getIBSMCPopulation
(int id) Helper routine to retrieve theIBSPopulation
associated with module withid
.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.Methods inherited from class IBS
check, debugStep, encodeState, getCounter, getFitnessData, getFitnessHistogramData, getFitnessNameAt, getIBSPopulation, getInitialTraits, getInitialTraits, getInteractionsAt, getMaxFitness, getMaxScore, getMeanFitness, getMeanFitness, getMeanTraits, getMeanTraits, getMinFitness, getMinScore, getNMean, getNMean, getRealtime, getScoreNameAt, getSpeciesUpdate, getStatus, getTagNameAt, getTraitData, getTraitNameAt, ibsStep, init, init, load, mouseHitNode, next, permitsDebugStep, permitsSampleStatistics, permitsUpdateStatistics, pickEvent, pickFocalSpecies, random01, random0n, reset, restoreState, unload, update
Methods inherited from class Model
getFixationData, getLogger, getMeanFitnessAt, getMeanName, getMeanNames, getMeanTraitAt, getMode, getNextHalt, getNSamples, getNSpecies, getNStatisticsFailed, getNStatisticsSamples, getSpecies, getTime, getTimeRelax, getTimeStep, getTimeStop, getType, hasConverged, initStatisticsFailed, initStatisticsSample, isConnected, isContinuous, isDE, isIBS, isODE, isPDE, isRelaxing, isSDE, isTimeReversed, isType, permitsMode, permitsTimeReversal, readStatisticsSample, relax, requestMode, resetStatisticsSample, setInitialTraits, setInitialTraits, setMode, setNSamples, setTimeRelax, setTimeReversed, setTimeStep, setTimeStop, useScheduling
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface CLOProvider
adjustCLO
-
Constructor Details
-
IBSC
Creates a population of individuals for IBS simulations with continuous traits/strategies.- Parameters:
engine
- the pacemaker for running the model
-
-
Method Details
-
getIBSMCPopulation
Helper routine to retrieve theIBSPopulation
associated with module withid
.- Parameters:
id
- theid
of the module- Returns:
- the
IBSPopulation
-
getTraitMin
public double[] getTraitMin(int id) Description copied from interface:Continuous
Gets the minimum trait values in this module.- Specified by:
getTraitMin
in interfaceContinuous
- Parameters:
id
- the id of the population for multi-species models- Returns:
- the array with the minimum trait values
-
getTraitMax
public double[] getTraitMax(int id) Description copied from interface:Continuous
Gets the maximum trait values in this module.- Specified by:
getTraitMax
in interfaceContinuous
- Parameters:
id
- the id of the population for multi-species models- Returns:
- the array with the maximum trait values
-
getMinMonoScore
public double getMinMonoScore(int id) Description copied from interface:Continuous
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.- Specified by:
getMinMonoScore
in interfaceContinuous
- Parameters:
id
- the id of the population for multi-species models- Returns:
- the minimum monomorphic score
-
getMaxMonoScore
public double getMaxMonoScore(int id) Description copied from interface:Continuous
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.- Specified by:
getMaxMonoScore
in interfaceContinuous
- Parameters:
id
- the id of the population for multi-species models- Returns:
- the maximum monomorphic score
-
getTraitHistogramData
public void getTraitHistogramData(int id, double[][] bins) Description copied from interface:Continuous
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).- Specified by:
getTraitHistogramData
in interfaceContinuous
- Parameters:
id
- the id of the population for multi-species modelsbins
- the 2D data array for storing the histogram
-
get2DTraitHistogramData
public void get2DTraitHistogramData(int id, double[] bins, int trait1, int trait2) Description copied from interface:Continuous
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.- Specified by:
get2DTraitHistogramData
in interfaceContinuous
- 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:
-
collectCLO
Description copied from interface:CLOProvider
All providers of command line options must implement this method to collect their options.Each command line option is (uniquely) identified by it's name (see
CLOption.getName()
), which corresponds to the long version of the option. If an attempt is made to add an option with a name that already exists, theparser
issues a warning and ignores the option. Thus, in general, implementing subclasses should first register their options and callsuper.collectCLO(CLOParser)
at the end such that subclasses are able to override command line options specified in a parental class.Override this method in subclasses to add further command line options. Subclasses must make sure that they include a call to super.
- Specified by:
collectCLO
in interfaceCLOProvider
- Overrides:
collectCLO
in classIBS
- Parameters:
parser
- the reference to parser that manages command line options- See Also:
-