Class IBSC
- All Implemented Interfaces:
Continuous,CLOProvider
IBS parent.- Author:
- Christoph Hauert
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe initialization of populations with continuous traits.Nested classes/interfaces inherited from class IBS
IBS.Event, IBS.HasIBS, IBS.MigrationType, IBS.ScoringType, IBS.StatisticsNested classes/interfaces inherited from class Model
Model.HasDE -
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, statisticsSettingsFields 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 TypeMethodDescriptionvoidcollectCLO(CLOParser parser) All providers of command line options must implement this method to collect their options.voidget2DTraitHistogramData(int id, double[] bins, int trait1, int trait2) Gets the histogram of the trait distribution for the traits of theModule.(package private) IBSMCPopulationgetIBSMCPopulation(int id) Helper routine to retrieve theIBSPopulationassociated with module withid.doublegetMaxMonoScore(int id) Calculates and returns maximum score in monomorphic population.doublegetMinMonoScore(int id) Calculates and returns minimum score in monomorphic population.voidgetTraitHistogramData(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, 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, updateMethods 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, isDensity, isRelaxing, isTimeReversed, permitsMode, permitsTimeReversal, readStatisticsSample, relax, requestMode, resetStatisticsSample, setMode, setNSamples, setTimeRelax, setTimeReversed, setTimeStep, setTimeStop, useSchedulingMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CLOProvider
adjustCLO
-
Constructor Details
-
IBSC
Creates a population of individuals for IBS simulations with continuous traits.- Parameters:
engine- the pacemaker for running the model
-
-
Method Details
-
getIBSMCPopulation
Helper routine to retrieve theIBSPopulationassociated with module withid.- Parameters:
id- theidof the module- Returns:
- the
IBSPopulation
-
getTraitMin
public double[] getTraitMin(int id) Description copied from interface:ContinuousGets the minimum trait values in this module.- Specified by:
getTraitMinin 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:ContinuousGets the maximum trait values in this module.- Specified by:
getTraitMaxin 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:ContinuousCalculates 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 currentModeltogether with the species ID for multi-species modules.- Specified by:
getMinMonoScorein 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:ContinuousCalculates 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 currentModeltogether with the species ID for multi-species modules.- Specified by:
getMaxMonoScorein 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:ContinuousGets 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:
getTraitHistogramDatain 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:ContinuousGets the histogram of the trait distribution for the traits of theModule. For modules with multiple traits a 2D histogram is generated for traitstrait1andtrait2. The histogram is returned in the linear arraybinsand arranged in a way that is compatible with square lattice geometries for visualization byDistribution(GWT only). For modules with a single trait only,trait1andtrait2are ignored.- Specified by:
get2DTraitHistogramDatain 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:CLOProviderAll 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, theparserissues 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:
collectCLOin interfaceCLOProvider- Overrides:
collectCLOin classIBS- Parameters:
parser- the reference to parser that manages command line options- See Also:
-