Nemo  2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
updaterservices.h
Go to the documentation of this file.
1
30#ifndef UPDATERSERVICES_H
31#define UPDATERSERVICES_H
32
33#include <map>
34#include <list>
35#include "service.h"
36#include "param.h"
37
38using namespace std;
39
40class SimComponent;
64class UpdaterServices : public Service {
65
66private:
67
68 map< unsigned int, list< Param* > > _paramUpdater;
69 map< unsigned int, list< ParamUpdaterBase* > > _componentUpdater;
70 list< ParamUpdaterBase* > _updaters;
71
72public:
73
75 virtual ~UpdaterServices () {reset();}
76
77 virtual bool init ();
78 virtual void notify () {}
80 virtual void notify (unsigned int generation);
82 virtual void load ( SimComponent* sc );
84 virtual void attach ( Handler* H );
86 virtual void reset();
88 void update_params (unsigned int generation);
90 void update_components (unsigned int generation);
92 bool hasTemporals () {return !_paramUpdater.empty();}
93};
94
95#endif
Service handler (an observer).
Definition: handler.h:36
Interface for the simulation services (files and stats).
Definition: service.h:43
Interface to all basic components of a simulation (traits, life cycle events, pop,...
Definition: simcomponent.h:45
Class to update the simulation components' state during a simulation.
Definition: updaterservices.h:64
list< ParamUpdaterBase * > _updaters
Definition: updaterservices.h:70
map< unsigned int, list< Param * > > _paramUpdater
Definition: updaterservices.h:68
map< unsigned int, list< ParamUpdaterBase * > > _componentUpdater
Definition: updaterservices.h:69
UpdaterServices()
Definition: updaterservices.h:74
virtual void notify()
Definition: updaterservices.h:78
virtual ~UpdaterServices()
Definition: updaterservices.h:75
void update_params(unsigned int generation)
Calls the parameters updating procedure.
Definition: updaterservices.cc:123
bool hasTemporals()
Checks if any updater has been uploaded.
Definition: updaterservices.h:92
virtual bool init()
Definition: updaterservices.cc:39
virtual void load(SimComponent *sc)
Loads the updaters in case a component's parameter has temporal arguments.
Definition: updaterservices.cc:82
virtual void attach(Handler *H)
Attach the updater to the stack.
Definition: updaterservices.cc:89
virtual void reset()
Clears the containers.
Definition: updaterservices.cc:61
void update_components(unsigned int generation)
Update the components using the functions stored in the updaters.
Definition: updaterservices.cc:137

Generated for Nemo v2.3.56 by  doxygen 1.9.0 -- Nemo is hosted on  Download Nemo

Locations of visitors to this page
Catalogued on GSR