Nemo
2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
|
Interface to all basic components of a simulation (traits, life cycle events, pop, etc. ). More...
#include <simcomponent.h>
Public Member Functions | |
SimComponent () | |
virtual | ~SimComponent () |
Services interface | |
virtual void | loadFileServices (FileServices *loader)=0 |
Loads the component's FileHandler onto the FileServices. More... | |
virtual void | loadStatServices (StatServices *loader)=0 |
Loads the component's StatHandler onto the StatServices. More... | |
virtual void | loadUpdaters (UpdaterServices *loader) |
Loads the parameters and component updater onto the updater manager. More... | |
Parameters handling | |
| |
virtual bool | setParameters ()=0 |
Default interface needed to initialize the component's variables from its input parameters value. More... | |
virtual void | set_paramset (ParamSet *paramset) |
Sets the ParamSet member. More... | |
virtual void | set_paramset (std::string name, bool required, SimComponent *owner) |
Sets a new ParamSet and name it. More... | |
virtual void | set_paramsetFromCopy (const ParamSet &PSet) |
Reset the set of parameters from a another set. More... | |
virtual ParamSet * | get_paramset () |
ParamSet accessor. More... | |
virtual void | add_parameter (Param *param) |
Interface to add a parameter to the set. More... | |
virtual void | add_parameter (std::string Name, param_t Type, bool isRequired, bool isBounded, double low_bnd, double up_bnd) |
Interface to add a parameter to the set. More... | |
virtual void | add_parameter (std::string Name, param_t Type, bool isRequired, bool isBounded, double low_bnd, double up_bnd, ParamUpdaterBase *updater) |
Interface to add a parameter and its updater to the set. More... | |
virtual Param * | get_parameter (std::string name) |
Param getter. More... | |
virtual double | get_parameter_value (std::string name) |
Param value getter. More... | |
virtual string | get_name () |
Returnd the name of the ParamSet, i.e. More... | |
virtual bool | has_parameter (std::string name) |
Param getter. More... | |
virtual bool | resetParameterFromSource (std::string param, SimComponent *cmpt)=0 |
Protected Attributes | |
ParamSet * | _paramSet |
The parameters container. More... | |
Interface to all basic components of a simulation (traits, life cycle events, pop, etc. ).
Implements the interface to handle the files and stats handler, the parameter updaters, and the parameters container. Contains the component's parameters and declares the interface to interact with its parameters.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Interface to add a parameter to the set.
param | The parameter to add to the set |
References _paramSet, and ParamSet::add_param().
Referenced by TTProtoWithMap::addGeneticMapParameters(), LCE_Disperse_base::addParameters(), BinaryDataSaver::BinaryDataSaver(), LCE_Breed_base::LCE_Breed_base(), LCE_Breed_Disperse::LCE_Breed_Disperse(), LCE_Breed_Selection::LCE_Breed_Selection(), LCE_Breed_Selection_Disperse::LCE_Breed_Selection_Disperse(), LCE_Breed_Wolbachia::LCE_Breed_Wolbachia(), LCE_Cross::LCE_Cross(), LCE_Disperse_EvolDisp::LCE_Disperse_EvolDisp(), LCE_FileServicesNotifier::LCE_FileServicesNotifier(), LCE_Init_BDMI::LCE_Init_BDMI(), LCE_NtrlInit::LCE_NtrlInit(), LCE_Patch_Extinction::LCE_Patch_Extinction(), LCE_QuantiInit::LCE_QuantiInit(), LCE_QuantiModifier::LCE_QuantiModifier(), LCE_Resize::LCE_Resize(), LCE_Selection_base::LCE_Selection_base(), LCE_StatServiceNotifier::LCE_StatServiceNotifier(), Metapop::Metapop(), LifeCycleEvent::set_paramset(), TProtoBDMI::TProtoBDMI(), TProtoDeletMutations_bitstring::TProtoDeletMutations_bitstring(), TProtoDispersal::TProtoDispersal(), TProtoNeutralGenes::TProtoNeutralGenes(), TProtoQuanti::TProtoQuanti(), and TProtoWolbachia::TProtoWolbachia().
|
inlinevirtual |
Interface to add a parameter to the set.
Name | The param string name as read in the init file |
Type | The type of the argument (DBL=double, INT=integer, BOOL=boolean, STR=string, etc., see type.h) |
isRequired | True if the parameter is mandatory |
isBounded | True if the parameter takes bounded values as argument |
low_bnd | The lower value the argument can take |
up_bnd | The upper value the argument can take |
References _paramSet, and ParamSet::add_param().
|
inlinevirtual |
Interface to add a parameter and its updater to the set.
Name | The param string name as read in the init file |
Type | The type of the argument (DBL=double, INT=integer, BOOL=boolean, STR=string, etc., see type.h) |
isRequired | True if the parameter is mandatory |
isBounded | True if the parameter takes bounded values as argument |
low_bnd | The lower value the argument can take |
up_bnd | The upper value the argument can take |
updater | a pointer to a ParamUpdaterBase object used to reset its value during a simulation |
References _paramSet, and ParamSet::add_param().
|
inlinevirtual |
Returnd the name of the ParamSet, i.e.
the name of the component.
References _paramSet, and ParamSet::getName().
|
inlinevirtual |
Param getter.
Asks the ParamSet to return a pointer to Param name.
References _paramSet, and ParamSet::get_param().
Referenced by TTProtoWithMap::areGeneticMapParamSet(), LCE_Cross::execute(), LCE_Resize::execute(), TTProtoWithMap::isRecombinationFree(), LCE_Cross::loadFileServices(), LCE_Selection_base::loadFileServices(), Metapop::loadFileServices(), LCE_FileServicesNotifier::loadFileServices(), TProtoBDMI::loadFileServices(), TProtoDeletMutations_bitstring::loadFileServices(), TProtoNeutralGenes::loadFileServices(), TProtoQuanti::loadFileServices(), LCE_Breed_Wolbachia::loadFileServices(), Metapop::loadPopFromBinarySource(), TTProtoWithMap::recordRandomMap(), TProtoNeutralGenes::resetParameterFromSource(), LCE_Selection_base::set_local_optima(), LCE_Patch_Extinction::set_matrix_param(), LCE_Selection_base::set_param_rate_of_change(), LCE_Selection_base::set_sel_model(), LCE_Selection_base::set_std_rate_of_change(), LCE_Disperse_base::setBaseParameters(), TProtoQuanti::setContinuousMutationModel(), TProtoQuanti::setDiallelicMutationModel(), TProtoQuanti::setDominanceParameters(), TProtoDeletMutations_bitstring::setEffectsFromInput(), LCE_Breed_base::setFecundity(), TTProtoWithMap::setGeneticMapParameters(), LCE_Breed_base::setMatingSystem(), TProtoQuanti::setMutationParameters(), TProtoDispersal::setNonRandom(), TTProtoWithMap::setNumLociPerChromosome(), BinaryDataSaver::setParameters(), LCE_Breed_Disperse::setParameters(), LCE_Breed_Selection::setParameters(), LCE_Breed_Selection_Disperse::setParameters(), LCE_Disperse_EvolDisp::setParameters(), LCE_Patch_Extinction::setParameters(), LCE_Cross::setParameters(), LCE_QuantiInit::setParameters(), LCE_QuantiModifier::setParameters(), LCE_Breed_Quanti::setParameters(), LCE_Selection_base::setParameters(), LCE_FileServicesNotifier::setParameters(), TProtoBDMI::setParameters(), LCE_Init_BDMI::setParameters(), TProtoDeletMutations_bitstring::setParameters(), TProtoDispersal::setParameters(), TProtoNeutralGenes::setParameters(), TProtoQuanti::setParameters(), LCE_Breed_Wolbachia::setParameters(), TProtoDispersal::setRandom(), TTProtoWithMap::setRecombinationMapRandom(), LCE_Selection_base::setSelectionMatrix(), TProtoDeletMutations_bitstring::setSelectionParameters(), LCE_Breed_base::setSexRatio(), Metapop::setSourceParameters(), LCE_Resize::updateParameters(), and TProtoDeletMutations_bitstring::write_effects_to_parameter().
|
inlinevirtual |
Param value getter.
Asks the ParamSet to return the value of Param name.
References _paramSet, and ParamSet::getValue().
Referenced by LifeCycleEvent::get_rank(), TTProtoWithMap::isRecombinationFree(), Metapop::loadFileServices(), LCE_Selection_base::set_param_rate_of_change(), LCE_Selection_base::set_sel_model(), LCE_Selection_base::set_std_rate_of_change(), LCE_Disperse_base::setBasicLatticeMatrix(), TProtoQuanti::setContinuousMutationModel(), TProtoQuanti::setDiallelicMutationModel(), TProtoQuanti::setDominanceParameters(), LCE_Breed_base::setFecundity(), TTProtoWithMap::setGeneticMapParameters(), LCE_Disperse_base::setLatticeMatrix(), LCE_Disperse_base::setLatticeTorrusMatrix(), LCE_Breed_base::setMatingSystem(), TProtoQuanti::setMutationParameters(), TProtoDispersal::setNonRandom(), BinaryDataSaver::setParameters(), LCE_Breed_Disperse::setParameters(), LCE_Breed_Selection::setParameters(), LCE_Breed_Selection_Disperse::setParameters(), LCE_Patch_Extinction::setParameters(), LCE_Cross::setParameters(), LCE_Resize::setParameters(), LCE_QuantiModifier::setParameters(), LCE_FileServicesNotifier::setParameters(), TProtoBDMI::setParameters(), TProtoDeletMutations_bitstring::setParameters(), TProtoDispersal::setParameters(), TProtoNeutralGenes::setParameters(), TProtoQuanti::setParameters(), TProtoWolbachia::setParameters(), LCE_Breed_Wolbachia::setParameters(), LCE_Disperse_ConstDisp::setParameters(), LCE_Disperse_base::setReducedDispMatrix(), LCE_Selection_base::setSelectionMatrix(), TProtoDeletMutations_bitstring::setSelectionParameters(), and LCE_Disperse_base::setSteppingStone1DMatrix().
|
inlinevirtual |
ParamSet accessor.
References _paramSet.
Referenced by LCE_Resize::execute(), BinaryDataLoader::extractPop(), and LCE_StatServiceNotifier::loadStatServices().
|
inlinevirtual |
Param getter.
Asks the ParamSet if it has a parameter named name.
References _paramSet, and ParamSet::has_param().
Referenced by Metapop::loadPopFromBinarySource().
|
pure virtual |
Loads the component's FileHandler onto the FileServices.
loader | the file service |
Implemented in BinaryDataSaver, LCE_Breed, LCE_Breed_Disperse, LCE_Breed_Selection, LCE_Breed_Selection_Disperse, LCE_Disperse_base, LCE_Regulation, LCE_Aging, LCE_Patch_Extinction, LCE_Cross, LCE_Resize, LCE_QuantiInit, LCE_QuantiModifier, LCE_Breed_Quanti, LCE_Selection_base, Metapop, LCE_ParamUpdaterNotifier, LCE_FileServicesNotifier, LCE_StatServiceNotifier, TProtoBDMI, LCE_Init_BDMI, TProtoDeletMutations_bitstring, TProtoDispersal, TProtoNeutralGenes, LCE_NtrlInit, TProtoQuanti, TProtoWolbachia, and LCE_Breed_Wolbachia.
Referenced by FileServices::load().
|
pure virtual |
Loads the component's StatHandler onto the StatServices.
loader | the stat service |
Implemented in BinaryDataSaver, LCE_Breed, LCE_Breed_Disperse, LCE_Breed_Selection, LCE_Breed_Selection_Disperse, LCE_Disperse_base, LCE_Regulation, LCE_Aging, LCE_Patch_Extinction, LCE_Cross, LCE_Resize, LCE_QuantiInit, LCE_QuantiModifier, LCE_Breed_Quanti, LCE_Selection_base, Metapop, LCE_ParamUpdaterNotifier, LCE_FileServicesNotifier, LCE_StatServiceNotifier, TProtoBDMI, LCE_Init_BDMI, TProtoDeletMutations_bitstring, TProtoDispersal, TProtoNeutralGenes, LCE_NtrlInit, TProtoQuanti, TProtoWolbachia, and LCE_Breed_Wolbachia.
Referenced by StatServices::load().
|
inlinevirtual |
Loads the parameters and component updater onto the updater manager.
loader | the updater manager |
Reimplemented in LCE_ParamUpdaterNotifier.
References _paramSet, UpdaterServices::attach(), and ParamSet::getUpdaters().
Referenced by UpdaterServices::load().
|
pure virtual |
Implemented in BinaryDataSaver, LCE_Breed, LCE_Breed_Disperse, LCE_Breed_Selection, LCE_Breed_Selection_Disperse, LCE_Disperse_base, LCE_Regulation, LCE_Aging, LCE_Patch_Extinction, LCE_Cross, LCE_Resize, LCE_QuantiInit, LCE_QuantiModifier, LCE_Breed_Quanti, LCE_Selection_base, Metapop, LCE_ParamUpdaterNotifier, LCE_FileServicesNotifier, LCE_StatServiceNotifier, TProtoBDMI, LCE_Init_BDMI, TProtoDeletMutations_bitstring, TProtoDispersal, TProtoNeutralGenes, LCE_NtrlInit, TProtoQuanti, TProtoWolbachia, and LCE_Breed_Wolbachia.
Referenced by Metapop::loadPopFromBinarySource().
|
inlinevirtual |
Sets the ParamSet member.
paramset | a pointer to a ParamSet object |
References _paramSet.
Referenced by LCE_Resize::execute(), Metapop::Metapop(), LifeCycleEvent::set_paramset(), TProtoBDMI::TProtoBDMI(), TProtoDeletMutations_bitstring::TProtoDeletMutations_bitstring(), TProtoDispersal::TProtoDispersal(), TProtoNeutralGenes::TProtoNeutralGenes(), TProtoQuanti::TProtoQuanti(), and TProtoWolbachia::TProtoWolbachia().
|
inlinevirtual |
Sets a new ParamSet and name it.
name | the name of the parameters container |
required | tag whether the component is required to run a simulation |
owner | a reference to the owner of the ParamSet (should be this). |
Reimplemented in LifeCycleEvent.
References _paramSet, ParamSet::setIsRequired(), ParamSet::setName(), and ParamSet::setOwner().
|
inlinevirtual |
|
pure virtual |
Default interface needed to initialize the component's variables from its input parameters value.
Formerly called 'init'.
Implemented in BinaryDataSaver, LCE_Breed_base, LCE_Breed, LCE_Breed_Disperse, LCE_Breed_Selection, LCE_Breed_Selection_Disperse, LCE_Disperse_ConstDisp, LCE_SeedDisp, LCE_Disperse_EvolDisp, LCE_Regulation, LCE_Aging, LCE_Patch_Extinction, LCE_Cross, LCE_Resize, LCE_QuantiInit, LCE_QuantiModifier, LCE_Breed_Quanti, LCE_Selection_base, Metapop, LCE_ParamUpdaterNotifier, LCE_FileServicesNotifier, LCE_StatServiceNotifier, TProtoBDMI, LCE_Init_BDMI, TProtoDeletMutations_bitstring, TProtoDispersal, TProtoNeutralGenes, LCE_NtrlInit, TProtoQuanti, TProtoWolbachia, and LCE_Breed_Wolbachia.
Referenced by LifeCycleEvent::init().
|
protected |
The parameters container.
Referenced by add_parameter(), LCE_Resize::execute(), get_name(), get_parameter(), get_parameter_value(), get_paramset(), has_parameter(), Metapop::init(), LCE_Selection_base::loadFileServices(), LCE_StatServiceNotifier::loadStatServices(), loadUpdaters(), LCE_Selection_base::set_fit_model(), LCE_Selection_base::set_local_optima(), set_paramset(), set_paramsetFromCopy(), LCE_Selection_base::set_sel_model(), LCE_Disperse_base::setBaseParameters(), LCE_Disperse_base::setIsland_PropagulePool_Matrix(), LCE_Disperse_base::setLatticeMatrix(), LCE_Breed_base::setMatingSystem(), LCE_StatServiceNotifier::setOccurence(), LCE_Breed_Disperse::setParameters(), LCE_Disperse_EvolDisp::setParameters(), LCE_Patch_Extinction::setParameters(), LCE_Resize::setParameters(), LCE_QuantiInit::setParameters(), LCE_StatServiceNotifier::setParameters(), LCE_Init_BDMI::setParameters(), LCE_NtrlInit::setParameters(), Metapop::setPatchCapacities(), Metapop::setPopulationParameters(), LCE_Selection_base::setSelectionMatrix(), TProtoDeletMutations_bitstring::setSelectionParameters(), Metapop::setSourceParameters(), TProtoBDMI::TProtoBDMI(), TProtoDeletMutations_bitstring::TProtoDeletMutations_bitstring(), TProtoDispersal::TProtoDispersal(), TProtoNeutralGenes::TProtoNeutralGenes(), TProtoQuanti::TProtoQuanti(), TProtoWolbachia::TProtoWolbachia(), LCE_Resize::updateParameters(), and ~SimComponent().