Nemo
2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
|
Provides methods to build the user's selected set of life cycle events and traits from the parameters. More...
#include <basicsimulation.h>
Public Member Functions | |
SimBuilder () | |
SimBuilder (const SimBuilder &SB) | |
copy cstor. More... | |
~SimBuilder () | |
bool | build_currentParams (map< string, string > &simparams) |
Builds the list of parameters from user's defined input parameters. More... | |
map< trait_t, TraitPrototype * > & | build_currentTraits () |
Selects the trait prototypes that have their parameters set. More... | |
void | build_LifeCycle () |
Selects the life cycle events that have their parameters set. More... | |
TraitPrototype * | get_current_trait (trait_t type) |
Accessor to the list of current trait prototypes. More... | |
TraitPrototype * | get_current_traitWithParameter (string ¶m) |
Accessor to the current trait prototypes conditioned on ownership of a specified parameter. More... | |
LifeCycleEvent * | get_current_event (string &name) |
Accessor to the list of current LCEs. More... | |
LifeCycleEvent * | get_current_eventWithParameter (string ¶m) |
Accessor to the current LCEs conditioned on ownership of a specified parameter. More... | |
list< ParamSet * > & | get_currentParams () |
Accessor to the list of the selected parameter sets. More... | |
age_t | getFirstRequiredAgeInLifeCycle () |
![]() | |
ParamManager () | |
Cstor. More... | |
~ParamManager () | |
void | add_paramset (ParamSet *paramset) |
Adds a ParamSet to the list of the parameter sets of the simulation. More... | |
ParamSet * | get_paramset (string &name) |
Looks for paramset with "name" in the list of parameter sets. More... | |
void | build_allParams () |
Clears and fills the _allParams list with the ParamSet's of the simulation components. More... | |
list< ParamSet * > & | get_allParams () |
Accessor of the whole list of the parameter sets. More... | |
bool | set_parameters (map< string, string > &simparams, bool silent) |
Sets the parameters of the simulation with the argument strings given in input. More... | |
bool | param_consistency_check () |
Checks if all the mandatory parameters are set so that the simulation can be launched. More... | |
void | build_records (map< string, vector< string > > &initParams) |
Builds the list of simulation parameters from the parsed input file(s). More... | |
list< map< string, string > > & | get_simRecords () |
Accessor to the simulations parameter list. More... | |
map< string, string > & | get_firstRecord () |
Accessor to the first element in the simulations parameter list. More... | |
int | get_nbSims () |
Accessor to the size of the simulations parameter list, i.e. More... | |
![]() | |
ComponentManager () | |
~ComponentManager () | |
void | build_component_list () |
Clears and builds the list of all components from the lists of trait prototype templates and life cycle event templates. More... | |
void | add_component (SimComponent *cmpt) |
Push a component at the back of the component list. More... | |
void | add_trait (TraitPrototype *trait) |
Add a trait prototype to the template and component lists. More... | |
void | add_LCE (LifeCycleEvent *event) |
Add a life cycle event to the template and component lists. More... | |
TraitPrototype * | get_trait (string name) |
Search for component with "name" in the trait prototype list. More... | |
LifeCycleEvent * | get_LCE (string name) |
Search for component with "name" in the life cycle events list. More... | |
Protected Types | |
typedef map< int, LifeCycleEvent * >::const_iterator | LCE_ITER |
typedef map< trait_t, TraitPrototype * >::const_iterator | TRAIT_ITER |
Protected Attributes | |
list< ParamSet * > | _currentParams |
List of the selected simulation components from the user defined input parameters. More... | |
map< trait_t, TraitPrototype * > | _currentTraits |
List of the selected trait prototypes from the user defined input parameters. More... | |
map< int, LifeCycleEvent * > | _LifeCycle |
List of the selected life cycle events from the user defined input parameters. More... | |
![]() | |
list< ParamSet * > | _allParams |
A list of all the parameter sets of all the simulation components loaded in the _component list of the ComponentManager. More... | |
map< string, string > | _inputParams |
A map of the parameters and their arguments of the current (running) simulation. More... | |
map< unsigned int, list< pair< string, string > > > | _temporalParams |
Lists of parameters to be updated during a simulation indexed by generation update time. More... | |
list< map< string, string > > | _simRecords |
Sets of parameters of all the simulations to perform. More... | |
ParamSet | _paramSet |
The ParamSet param set of the simulation. More... | |
![]() | |
list< SimComponent * > | _components |
List of all the simulation components. More... | |
list< TraitPrototype * > | _TTrait_Templates |
List of all trait prototypes of the simulation, a subset of _components list. More... | |
list< LifeCycleEvent * > | _LCE_Templates |
List of all the life-cycle events of the simulation, a subset of _components list. More... | |
Provides methods to build the user's selected set of life cycle events and traits from the parameters.
This class implements methods to build the lists of selected traits and life cycle events from the user's defined parameters. Each simulation component that has its ParamSet in the "set" state is elligible to be part of the current simulation. Accessors to these components are provided. This class does however not provide a runnable simulation object.
|
protected |
|
protected |
|
inline |
SimBuilder::SimBuilder | ( | const SimBuilder & | SB | ) |
copy cstor.
References ComponentManager::_LCE_Templates, ParamManager::_paramSet, ComponentManager::_TTrait_Templates, ComponentManager::add_LCE(), ComponentManager::add_trait(), and ParamManager::build_allParams().
SimBuilder::~SimBuilder | ( | ) |
References ComponentManager::_components, ComponentManager::_LCE_Templates, ComponentManager::_TTrait_Templates, and message().
bool SimBuilder::build_currentParams | ( | map< string, string > & | simparams | ) |
Builds the list of parameters from user's defined input parameters.
simparams | Hashtable of the parsed input parameters |
References ParamManager::_allParams, _currentParams, message(), and ParamManager::set_parameters().
Referenced by BinaryDataLoader::extractPop(), and SimRunner::init_components().
map< trait_t, TraitPrototype * > & SimBuilder::build_currentTraits | ( | ) |
Selects the trait prototypes that have their parameters set.
References _currentTraits, and ComponentManager::_TTrait_Templates.
Referenced by BinaryDataLoader::extractPop(), and SimRunner::init_components().
void SimBuilder::build_LifeCycle | ( | ) |
Selects the life cycle events that have their parameters set.
References ComponentManager::_LCE_Templates, and _LifeCycle.
Referenced by SimRunner::setLifeCycle().
LifeCycleEvent * SimBuilder::get_current_event | ( | string & | name | ) |
Accessor to the list of current LCEs.
name | the name of the LCE |
References _LifeCycle.
Referenced by Metapop::loadPopFromBinarySource(), and SimRunner::run_event().
LifeCycleEvent * SimBuilder::get_current_eventWithParameter | ( | string & | param | ) |
Accessor to the current LCEs conditioned on ownership of a specified parameter.
the | name of the parameter of interest |
References _LifeCycle.
Referenced by Metapop::loadPopFromBinarySource().
TraitPrototype * SimBuilder::get_current_trait | ( | trait_t | type | ) |
Accessor to the list of current trait prototypes.
type | the trait type |
References _currentTraits.
Referenced by Metapop::loadPopFromBinarySource().
TraitPrototype * SimBuilder::get_current_traitWithParameter | ( | string & | param | ) |
Accessor to the current trait prototypes conditioned on ownership of a specified parameter.
the | name of the parameter of interest |
References _currentTraits.
Referenced by Metapop::loadPopFromBinarySource().
|
inline |
Accessor to the list of the selected parameter sets.
References _currentParams.
age_t SimBuilder::getFirstRequiredAgeInLifeCycle | ( | ) |
References _LifeCycle, and NONE.
Referenced by Metapop::setPopulation().
|
protected |
List of the selected simulation components from the user defined input parameters.
Referenced by build_currentParams(), and get_currentParams().
|
protected |
List of the selected trait prototypes from the user defined input parameters.
Referenced by build_currentTraits(), get_current_trait(), get_current_traitWithParameter(), SimRunner::register_component_handlers(), and SimRunner::run().
|
protected |
List of the selected life cycle events from the user defined input parameters.
Referenced by build_LifeCycle(), get_current_event(), get_current_eventWithParameter(), getFirstRequiredAgeInLifeCycle(), SimRunner::init_components(), SimRunner::register_component_handlers(), SimRunner::run(), SimRunner::setLifeCycle(), and SimRunner::step().