Class IBSD
- All Implemented Interfaces:
Discrete
,CLOProvider
IBS
parent.- Author:
- Christoph Hauert
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The initialization of populations with discrete traits.static enum
Type of optimizations.Nested classes/interfaces inherited from class IBS
IBS.Event, IBS.HasIBS, IBS.MigrationType, IBS.ScoringType, IBS.Statistics
-
Field Summary
FieldsFields 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 TypeMethodDescriptionboolean
check()
Check consistency of parameters and adjust if necessary (and possible).void
collectCLO
(CLOParser parser) All providers of command line options must implement this method to collect their options.(package private) IBSDPopulation
getIBSDPopulation
(int id) Helper routine to retrieve theIBSDPopulation
associated with module withid
.double
getMonoScore
(int id, int idx) Calculate and return the payoff/score of individuals in monomorphic populations with trait/strategyidx
but also deals with payoff accounting (averaged versus accumulated).boolean
Check if the current model settings permit sample statistics.void
Signal that statistics sample is ready to process.void
Reset statistics and get ready to start new collection.boolean
setInitialTraits
(double[] init) Set initial traits in one or all species.boolean
setInitialTraits
(int id, double[] init) Set initial trait values for species with IDid
.void
unload()
Milestone: Unload this model and free resources (if applicable).Methods inherited from class IBS
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, permitsUpdateStatistics, pickEvent, pickFocalSpecies, random01, random0n, reset, restoreState, 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, relax, requestMode, 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
-
Field Details
-
cloOptimize
Command line option to request optimizations.
-
-
Constructor Details
-
IBSD
Creates a population of individuals for IBS simulations with discrete traits/strategies.- Parameters:
engine
- the pacemaker for running the model
-
-
Method Details
-
readStatisticsSample
public void readStatisticsSample()Description copied from class:Model
Signal that statistics sample is ready to process.- Overrides:
readStatisticsSample
in classModel
-
resetStatisticsSample
public void resetStatisticsSample()Description copied from class:Model
Reset statistics and get ready to start new collection.- Overrides:
resetStatisticsSample
in classModel
-
permitsSampleStatistics
public boolean permitsSampleStatistics()Description copied from class:Model
Check if the current model settings permit sample statistics. Fixation probabilities and times are examples of statistics based on samples.- Overrides:
permitsSampleStatistics
in classIBS
- Returns:
true
if sample statistics are permitted
-
unload
public void unload()Description copied from class:Model
Milestone: Unload this model and free resources (if applicable). -
check
public boolean check()Description copied from class:Model
Check consistency of parameters and adjust if necessary (and possible). All issues and modifications should be reported throughlogger
. Some parameters can be adjusted while the model remains active or even while running, whereas others require a reset. An example of the former category is in general simple adjustments of payoffs, while an example of the latter category is a change of the population structure. -
getIBSDPopulation
Helper routine to retrieve theIBSDPopulation
associated with module withid
.- Parameters:
id
- theid
of the module- Returns:
- the
IBSDPopulation
-
setInitialTraits
public boolean setInitialTraits(double[] init) Description copied from class:Model
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.
- Overrides:
setInitialTraits
in classModel
- Parameters:
init
- the array with the initial trait values- Returns:
true
if initial traits successfully set
-
setInitialTraits
public boolean setInitialTraits(int id, double[] init) Description copied from class:Model
Set initial trait values for species with IDid
.- Overrides:
setInitialTraits
in classModel
- Parameters:
id
- the species identifierinit
- the array with the initial trait values- Returns:
true
if initial traits successfully set
-
getMonoScore
public double getMonoScore(int id, int idx) Description copied from interface:Discrete
Calculate and return the payoff/score of individuals in monomorphic populations with trait/strategyidx
but also deals with payoff accounting (averaged versus accumulated).- Specified by:
getMonoScore
in interfaceDiscrete
- Parameters:
id
- the id of the population for multi-species modelsidx
- trait/strategy- Returns:
- payoff/score in monomorphic population with trait/strategy
idx
. ReturnsNaN
if scores ill defined - 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:
-