29#ifndef BASICSIMULATION_H
30#define BASICSIMULATION_H
125 bool set_parameters (map< string,string >& simparams,
bool silent);
133 void build_records (map<
string, vector<string> >& initParams);
155 string setFilename (
string& fstring,
unsigned int sim, vector<string>& args, vector<unsigned int>& arg_no,
bool check_arg_no);
157 string setArgString (
string& fmt,
string& arg,
unsigned int arg_pos);
226 typedef map< int, LifeCycleEvent* >::const_iterator
LCE_ITER;
227 typedef map< trait_t, TraitPrototype* >::const_iterator
TRAIT_ITER;
Class to manage the simulation components and prototypes.
Definition: basicsimulation.h:46
list< LifeCycleEvent * > _LCE_Templates
List of all the life-cycle events of the simulation, a subset of _components list.
Definition: basicsimulation.h:75
void build_component_list()
Clears and builds the list of all components from the lists of trait prototype templates and life cyc...
Definition: basicsimulation.cc:40
list< TraitPrototype * > _TTrait_Templates
List of all trait prototypes of the simulation, a subset of _components list.
Definition: basicsimulation.h:73
void add_component(SimComponent *cmpt)
Push a component at the back of the component list.
Definition: basicsimulation.h:54
void add_LCE(LifeCycleEvent *event)
Add a life cycle event to the template and component lists.
Definition: basicsimulation.h:58
~ComponentManager()
Definition: basicsimulation.h:50
LifeCycleEvent * get_LCE(string name)
Search for component with "name" in the life cycle events list.
Definition: basicsimulation.cc:77
TraitPrototype * get_trait(string name)
Search for component with "name" in the trait prototype list.
Definition: basicsimulation.cc:61
list< SimComponent * > _components
List of all the simulation components.
Definition: basicsimulation.h:71
void add_trait(TraitPrototype *trait)
Add a trait prototype to the template and component lists.
Definition: basicsimulation.h:56
ComponentManager()
Definition: basicsimulation.h:49
Base class of the Life Cycle Events, declares the LCE interface.
Definition: lifecycleevent.h:73
Class to manage the sets of parameters of the simulation components.
Definition: basicsimulation.h:89
void build_records(map< string, vector< string > > &initParams)
Builds the list of simulation parameters from the parsed input file(s).
Definition: basicsimulation.cc:250
list< ParamSet * > & get_allParams()
Accessor of the whole list of the parameter sets.
Definition: basicsimulation.h:108
~ParamManager()
Definition: basicsimulation.h:93
map< string, string > & get_firstRecord()
Accessor to the first element in the simulations parameter list.
Definition: basicsimulation.h:137
list< map< string, string > > _simRecords
Sets of parameters of all the simulations to perform.
Definition: basicsimulation.h:149
ParamManager()
Cstor.
Definition: basicsimulation.cc:97
int get_nbSims()
Accessor to the size of the simulations parameter list, i.e.
Definition: basicsimulation.h:139
bool set_parameters(map< string, string > &simparams, bool silent)
Sets the parameters of the simulation with the argument strings given in input.
Definition: basicsimulation.cc:151
void build_allParams()
Clears and fills the _allParams list with the ParamSet's of the simulation components.
Definition: basicsimulation.cc:116
list< ParamSet * > _allParams
A list of all the parameter sets of all the simulation components loaded in the _component list of th...
Definition: basicsimulation.h:143
map< unsigned int, list< pair< string, string > > > _temporalParams
Lists of parameters to be updated during a simulation indexed by generation update time.
Definition: basicsimulation.h:147
ParamSet _paramSet
The ParamSet param set of the simulation.
Definition: basicsimulation.h:151
ParamSet * get_paramset(string &name)
Looks for paramset with "name" in the list of parameter sets.
Definition: basicsimulation.cc:232
map< string, string > _inputParams
A map of the parameters and their arguments of the current (running) simulation.
Definition: basicsimulation.h:145
list< map< string, string > > & get_simRecords()
Accessor to the simulations parameter list.
Definition: basicsimulation.h:135
string lowercase(string &input)
Definition: basicsimulation.cc:597
void add_paramset(ParamSet *paramset)
Adds a ParamSet to the list of the parameter sets of the simulation.
Definition: basicsimulation.h:95
string setFilename(string &fstring, unsigned int sim, vector< string > &args, vector< unsigned int > &arg_no, bool check_arg_no)
Definition: basicsimulation.cc:407
string setArgString(string &fmt, string &arg, unsigned int arg_pos)
Definition: basicsimulation.cc:512
string stripFormatString(string &str, unsigned int &index)
Definition: basicsimulation.cc:477
bool param_consistency_check()
Checks if all the mandatory parameters are set so that the simulation can be launched.
Definition: basicsimulation.cc:132
Parameters container, implemented in each SimComponent.
Definition: param.h:206
Provides methods to build the user's selected set of life cycle events and traits from the parameters...
Definition: basicsimulation.h:168
map< int, LifeCycleEvent * >::const_iterator LCE_ITER
Definition: basicsimulation.h:226
LifeCycleEvent * get_current_event(string &name)
Accessor to the list of current LCEs.
Definition: basicsimulation.cc:683
void build_LifeCycle()
Selects the life cycle events that have their parameters set.
Definition: basicsimulation.cc:762
age_t getFirstRequiredAgeInLifeCycle()
Definition: basicsimulation.cc:784
map< trait_t, TraitPrototype * > _currentTraits
List of the selected trait prototypes from the user defined input parameters.
Definition: basicsimulation.h:222
list< ParamSet * > _currentParams
List of the selected simulation components from the user defined input parameters.
Definition: basicsimulation.h:220
~SimBuilder()
Definition: basicsimulation.cc:628
LifeCycleEvent * get_current_eventWithParameter(string ¶m)
Accessor to the current LCEs conditioned on ownership of a specified parameter.
Definition: basicsimulation.cc:698
bool build_currentParams(map< string, string > &simparams)
Builds the list of parameters from user's defined input parameters.
Definition: basicsimulation.cc:715
SimBuilder()
Definition: basicsimulation.h:170
TraitPrototype * get_current_traitWithParameter(string ¶m)
Accessor to the current trait prototypes conditioned on ownership of a specified parameter.
Definition: basicsimulation.cc:666
map< trait_t, TraitPrototype * >::const_iterator TRAIT_ITER
Definition: basicsimulation.h:227
map< int, LifeCycleEvent * > _LifeCycle
List of the selected life cycle events from the user defined input parameters.
Definition: basicsimulation.h:224
map< trait_t, TraitPrototype * > & build_currentTraits()
Selects the trait prototypes that have their parameters set.
Definition: basicsimulation.cc:741
list< ParamSet * > & get_currentParams()
Accessor to the list of the selected parameter sets.
Definition: basicsimulation.h:214
TraitPrototype * get_current_trait(trait_t type)
Accessor to the list of current trait prototypes.
Definition: basicsimulation.cc:654
Interface to all basic components of a simulation (traits, life cycle events, pop,...
Definition: simcomponent.h:45
TTrait setter.
Definition: ttrait.h:125
std::string trait_t
Trait types.
Definition: types.h:63
unsigned int age_t
Age class flags.
Definition: types.h:46