Class IBSD
- All Implemented Interfaces:
DModel, CLOProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe initialization of populations with discrete traits.static enumType of optimizations.Nested classes/interfaces inherited from class IBS
IBS.Event, IBS.MigrationType, IBS.ScoringType, IBS.StatisticsNested classes/interfaces inherited from class Model
Model.HasDE, Model.HasIBS -
Field Summary
FieldsFields inherited from class IBS
cloAccumulatedScores, cloConsistency, cloGeometryAddwire, cloGeometryCompetition, cloGeometryInteraction, cloGeometryRewire, cloInteractions, cloMigration, cloReferences, cloScoringType, debugFocalSpecies, ephrng, isSynchronous, nTotal, population, speciesUpdate, statisticsSettings, updatesFields 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.(package private) IBSDPopulationgetIBSDPopulation(int id) Helper routine to retrieve theIBSDPopulationassociated with module withid.voidgetInitialTraits(double[] init) Collect and return initial trait values for all species.voidgetInitialTraits(int id, double[] init) Return initial trait values for species with IDid.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).booleanCheck if the current model settings permit sample statistics.voidSignal that statistics sample is ready to process.voidReset statistics and get ready to start new collection.booleansetInitialTraits(double[] init) Set initial traits in one or all species.booleansetInitialTraits(int id, double[] init) Set initial trait values for species with IDid.voidunload()Milestone: Unload this model and free resources (if applicable).Methods inherited from class IBS
check, debugStep, encodeState, getCounter, getFitnessData, getFitnessHistogramData, getFitnessNameAt, getIBSPopulation, getInteractionsAt, getMaxFitness, getMaxScore, getMeanFitness, getMeanFitness, getMeanTraits, getMeanTraits, getMinFitness, getMinScore, getNMean, getNMean, getScoreNameAt, getSpeciesUpdate, getStatus, getTagNameAt, getTime, getTraitData, getTraitNameAt, getUpdates, ibsStep, init, init, load, mouseHitNode, next, permitsDebugStep, permitsUpdateStatistics, pickEvent, pickFocalSpecies, random01, random0n, reset, resetState, restoreState, setMode, updateMethods inherited from class Model
getFixationData, getLogger, getMeanFitnessAt, getMeanName, getMeanNames, getMeanTraitAt, getMode, getNextHalt, getNSamples, getNSpecies, getNStatisticsFailed, getNStatisticsSamples, getSpecies, getTimeRelax, getTimeStep, getTimeStop, getType, hasConverged, initStatisticsFailed, initStatisticsSample, isConnected, isContinuous, isDensity, isRelaxing, isTimeReversed, permitsMode, permitsTimeReversal, relax, requestMode, 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
-
Field Details
-
cloOptimize
Command line option to request optimizations.
-
-
Constructor Details
-
IBSD
Creates a population of individuals for IBS simulations with discrete traits.- Parameters:
engine- the pacemaker for running the model
-
-
Method Details
-
readStatisticsSample
public void readStatisticsSample()Description copied from class:ModelSignal that statistics sample is ready to process.- Overrides:
readStatisticsSamplein classModel
-
resetStatisticsSample
public void resetStatisticsSample()Description copied from class:ModelReset statistics and get ready to start new collection.- Overrides:
resetStatisticsSamplein classModel
-
permitsSampleStatistics
public boolean permitsSampleStatistics()Description copied from class:ModelCheck if the current model settings permit sample statistics. Fixation probabilities and times are examples of statistics based on samples.- Overrides:
permitsSampleStatisticsin classIBS- Returns:
trueif sample statistics are permitted
-
unload
-
getIBSDPopulation
Helper routine to retrieve theIBSDPopulationassociated with module withid.- Parameters:
id- theidof the module- Returns:
- the
IBSDPopulation
-
getInitialTraits
public void getInitialTraits(double[] init) Description copied from interface:DModelCollect 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.
- Specified by:
getInitialTraitsin interfaceDModel- Parameters:
init- the array for storing the initial trait values
-
getInitialTraits
public void getInitialTraits(int id, double[] init) Description copied from interface:DModelReturn initial trait values for species with IDid.- Specified by:
getInitialTraitsin interfaceDModel- Parameters:
id- the species identifierinit- the array for storing the initial trait values
-
setInitialTraits
public boolean setInitialTraits(double[] init) Description copied from interface:DModelSet 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.
- Specified by:
setInitialTraitsin interfaceDModel- Parameters:
init- the array with the initial trait values- Returns:
trueif initial traits successfully set
-
setInitialTraits
public boolean setInitialTraits(int id, double[] init) Description copied from interface:DModelSet initial trait values for species with IDid.- Specified by:
setInitialTraitsin interfaceDModel- Parameters:
id- the species identifierinit- the array with the initial trait values- Returns:
trueif initial traits successfully set
-
getMonoScore
public double getMonoScore(int id, int idx) Description copied from interface:DModelCalculate and return the payoff/score of individuals in monomorphic populations with traitidxbut also deals with payoff accounting (averaged versus accumulated).- Specified by:
getMonoScorein interfaceDModel- 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:
-
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:
-