#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. | |
| virtual void | loadStatServices (StatServices *loader)=0 |
| Loads the component's StatHandler onto the StatServices. | |
| virtual void | loadUpdaters (UpdaterServices *loader) |
| Loads the parameters and component updater onto the updater manager. | |
Parameters handling | |
| virtual bool | setParameters ()=0 |
| Default interface needed to initialize the component's variables from its input parameters value. | |
| virtual void | set_paramset (ParamSet *paramset) |
| Sets the ParamSet member. | |
| virtual void | set_paramset (std::string name, bool required, SimComponent *owner) |
| Sets a new ParamSet and name it. | |
| virtual void | set_paramsetFromCopy (const ParamSet &PSet) |
| Reset the set of parameters from a another set. | |
| virtual ParamSet * | get_paramset () |
| ParamSet accessor. | |
| virtual void | add_parameter (Param *param) |
| Interface to add a parameter to the set. | |
| 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. | |
| 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. | |
| virtual Param * | get_parameter (std::string name) |
| Param getter. | |
| virtual double | get_parameter_value (std::string name) |
| Param value getter. | |
| virtual string | get_name () |
| Returnd the name of the ParamSet, i.e. | |
Protected Attributes | |
| ParamSet * | _paramSet |
| The parameters container. | |
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.
Definition at line 45 of file simcomponent.h.
| SimComponent::SimComponent | ( | ) | [inline] |
Definition at line 52 of file simcomponent.h.
00052 : _paramSet(0) {}//{ cout << "calling SimComponent()" << endl;}
| virtual SimComponent::~SimComponent | ( | ) | [inline, virtual] |
| virtual void SimComponent::add_parameter | ( | std::string | Name, | |
| param_t | Type, | |||
| bool | isRequired, | |||
| bool | isBounded, | |||
| double | low_bnd, | |||
| double | up_bnd, | |||
| ParamUpdaterBase * | updater | |||
| ) | [inline, virtual] |
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 |
Definition at line 133 of file simcomponent.h.
| virtual void SimComponent::add_parameter | ( | std::string | Name, | |
| param_t | Type, | |||
| bool | isRequired, | |||
| bool | isBounded, | |||
| double | low_bnd, | |||
| double | up_bnd | |||
| ) | [inline, virtual] |
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 |
Definition at line 121 of file simcomponent.h.
| virtual void SimComponent::add_parameter | ( | Param * | param | ) | [inline, virtual] |
Interface to add a parameter to the set.
| param | The parameter to add to the set |
Definition at line 112 of file simcomponent.h.
Referenced by BinaryDataSaver::BinaryDataSaver(), LCE_Breed_base::LCE_Breed_base(), LCE_Breed_Disperse::LCE_Breed_Disperse(), LCE_Breed_Selection_Disperse::LCE_Breed_Selection_Disperse(), LCE_Breed_Wolbachia::LCE_Breed_Wolbachia(), LCE_Cross::LCE_Cross(), LCE_Disperse_base::LCE_Disperse_base(), LCE_Disperse_EvolDisp::LCE_Disperse_EvolDisp(), LCE_Patch_Extinction::LCE_Patch_Extinction(), LCE_Resize::LCE_Resize(), LCE_Selection_base::LCE_Selection_base(), LCE_StatServiceNotifier::LCE_StatServiceNotifier(), Metapop::Metapop(), LifeCycleEvent::set_paramset(), TProtoDeletMutations_bitstring::TProtoDeletMutations_bitstring(), TProtoNeutralGenes::TProtoNeutralGenes(), and TProtoWolbachia::TProtoWolbachia().
| virtual string SimComponent::get_name | ( | ) | [inline, virtual] |
Returnd the name of the ParamSet, i.e.
the name of the component.
Definition at line 146 of file simcomponent.h.
| virtual Param* SimComponent::get_parameter | ( | std::string | name | ) | [inline, virtual] |
Param getter.
Asks the ParamSet to return a pointer to Param name.
Definition at line 139 of file simcomponent.h.
Referenced by LCE_Resize::execute(), TProtoNeutralGenes::loadFileServices(), TProtoDeletMutations_bitstring::loadFileServices(), LCE_Patch_Extinction::set_matrix_param(), LCE_Selection_base::set_sel_model(), LCE_Breed_base::setFecundity(), LCE_Breed_base::setMatingSystem(), TProtoNeutralGenes::setParameters(), TProtoDeletMutations_bitstring::setParameters(), LCE_Selection_base::setParameters(), LCE_Patch_Extinction::setParameters(), LCE_Breed_Selection_Disperse::setParameters(), BinaryDataSaver::setParameters(), LCE_Selection_base::setSelectionMatrix(), TProtoDeletMutations_bitstring::setSelectionParameters(), LCE_Breed_base::setSexRatio(), and LCE_Resize::updateParameters().
| virtual double SimComponent::get_parameter_value | ( | std::string | name | ) | [inline, virtual] |
Param value getter.
Asks the ParamSet to return the value of Param name.
Definition at line 143 of file simcomponent.h.
Referenced by LifeCycleEvent::get_rank(), LCE_Selection_base::set_sel_model(), LCE_Disperse_base::setBasicLatticeMatrix(), LCE_Breed_base::setFecundity(), LCE_Disperse_base::setLatticeMatrix(), LCE_Disperse_base::setLatticeReflectingMatrix(), LCE_Disperse_base::setLatticeTorrusMatrix(), LCE_Breed_base::setMatingSystem(), TProtoWolbachia::setParameters(), TProtoNeutralGenes::setParameters(), TProtoDeletMutations_bitstring::setParameters(), LCE_Resize::setParameters(), LCE_Cross::setParameters(), LCE_Patch_Extinction::setParameters(), LCE_Disperse_ConstDisp::setParameters(), LCE_Breed_Selection_Disperse::setParameters(), LCE_Breed_Disperse::setParameters(), LCE_Breed_Wolbachia::setParameters(), BinaryDataSaver::setParameters(), LCE_Selection_base::setSelectionMatrix(), TProtoDeletMutations_bitstring::setSelectionParameters(), and LCE_Disperse_base::setSteppingStone1DMatrix().
| virtual ParamSet* SimComponent::get_paramset | ( | ) | [inline, virtual] |
ParamSet accessor.
Definition at line 108 of file simcomponent.h.
Referenced by LCE_Resize::execute(), BinaryDataLoader::extractPop(), Metapop::loadPopFromTraitFile(), and LCE_StatServiceNotifier::loadStatServices().
00108 {return _paramSet;}
| virtual void SimComponent::loadFileServices | ( | FileServices * | loader | ) | [pure virtual] |
Loads the component's FileHandler onto the FileServices.
| loader | the file service |
Implemented in BinaryDataSaver, LCE_Breed, LCE_Breed_Wolbachia, 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_Selection_base, Metapop, LCE_ParamUpdaterNotifier, LCE_FileServicesNotifier, LCE_StatServiceNotifier, TProtoDeletMutations_bitstring, TProtoDispersal, TProtoNeutralGenes, and TProtoWolbachia.
Referenced by FileServices::load().
| virtual void SimComponent::loadStatServices | ( | StatServices * | loader | ) | [pure virtual] |
Loads the component's StatHandler onto the StatServices.
| loader | the stat service |
Implemented in BinaryDataSaver, LCE_Breed, LCE_Breed_Wolbachia, 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_Selection_base, Metapop, LCE_ParamUpdaterNotifier, LCE_FileServicesNotifier, LCE_StatServiceNotifier, TProtoDeletMutations_bitstring, TProtoDispersal, TProtoNeutralGenes, and TProtoWolbachia.
Referenced by StatServices::load().
| virtual void SimComponent::loadUpdaters | ( | UpdaterServices * | loader | ) | [inline, virtual] |
Loads the parameters and component updater onto the updater manager.
| loader | the updater manager |
Reimplemented in LCE_ParamUpdaterNotifier.
Definition at line 68 of file simcomponent.h.
Referenced by UpdaterServices::load().
00068 { 00069 list<ParamUpdaterBase*> updaters = _paramSet->getUpdaters(); 00070 //remove duplicates: 00071 updaters.unique(); 00072 for (list<ParamUpdaterBase*>::iterator u = updaters.begin(); u != updaters.end(); u++) { 00073 loader->attach( (*u) ); 00074 } 00075 }
| virtual void SimComponent::set_paramset | ( | std::string | name, | |
| bool | required, | |||
| SimComponent * | owner | |||
| ) | [inline, virtual] |
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.
Definition at line 93 of file simcomponent.h.
00093 { 00094 if(_paramSet != NULL) delete _paramSet; 00095 _paramSet = new ParamSet(); 00096 _paramSet->setName(name); 00097 _paramSet->setIsRequired(required); 00098 _paramSet->setOwner(owner); 00099 }
| virtual void SimComponent::set_paramset | ( | ParamSet * | paramset | ) | [inline, virtual] |
Sets the ParamSet member.
| paramset | a pointer to a ParamSet object |
Definition at line 86 of file simcomponent.h.
Referenced by LCE_Resize::execute(), Metapop::Metapop(), TProtoDeletMutations_bitstring::TProtoDeletMutations_bitstring(), TProtoNeutralGenes::TProtoNeutralGenes(), and TProtoWolbachia::TProtoWolbachia().
00087 { _paramSet = paramset; }
| virtual void SimComponent::set_paramsetFromCopy | ( | const ParamSet & | PSet | ) | [inline, virtual] |
Reset the set of parameters from a another set.
| PSet | the parameter set to copy parameters from |
Definition at line 103 of file simcomponent.h.
Referenced by Metapop::loadPopFromTraitFile().
| virtual bool SimComponent::setParameters | ( | ) | [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_Wolbachia, LCE_Breed_Disperse, LCE_Breed_Selection, LCE_Breed_Selection_Disperse, LCE_Disperse_base, LCE_Disperse_ConstDisp, LCE_Disperse_EvolDisp, LCE_Regulation, LCE_Aging, LCE_Patch_Extinction, LCE_Cross, LCE_Resize, LCE_Selection_base, Metapop, LCE_ParamUpdaterNotifier, LCE_FileServicesNotifier, LCE_StatServiceNotifier, TProtoDeletMutations_bitstring, TProtoDispersal, TProtoNeutralGenes, and TProtoWolbachia.
Referenced by LifeCycleEvent::init().
ParamSet* SimComponent::_paramSet [protected] |
The parameters container.
Definition at line 48 of file simcomponent.h.
Referenced by add_parameter(), LCE_Resize::execute(), get_name(), get_parameter(), get_parameter_value(), get_paramset(), Metapop::init(), loadUpdaters(), LCE_Selection_base::set_fit_model(), set_paramset(), set_paramsetFromCopy(), LCE_Selection_base::set_sel_model(), LCE_Disperse_base::setIsland_PropagulePool_Matrix(), LCE_Disperse_base::setLatticeMatrix(), LCE_Breed_base::setMatingSystem(), LCE_StatServiceNotifier::setParameters(), LCE_Resize::setParameters(), LCE_Patch_Extinction::setParameters(), LCE_Disperse_EvolDisp::setParameters(), LCE_Disperse_base::setParameters(), Metapop::setPatchCapacities(), Metapop::setPopulationParameters(), LCE_Selection_base::setSelectionMatrix(), TProtoDeletMutations_bitstring::setSelectionParameters(), Metapop::setSourceParameters(), LCE_Selection_base::setSpatialMatrix(), TProtoDeletMutations_bitstring::TProtoDeletMutations_bitstring(), TProtoNeutralGenes::TProtoNeutralGenes(), TProtoWolbachia::TProtoWolbachia(), LCE_Resize::updateParameters(), and ~SimComponent().
1.5.8 -- Nemo is hosted by