Nemo  2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
LCE_Regulation Class Reference

Regulates the patches to their carrying capacity, acts on each age class separately. More...

#include <LCEmisc.h>

+ Inheritance diagram for LCE_Regulation:
+ Collaboration diagram for LCE_Regulation:

Public Member Functions

 LCE_Regulation ()
 
virtual ~LCE_Regulation ()
 
void regulatePatch (Patch *patch, age_idx age, sex_t sex)
 
virtual bool setParameters ()
 
virtual void execute ()
 
virtual LCE_Regulationclone ()
 
virtual void loadFileServices (FileServices *loader)
 
virtual void loadStatServices (StatServices *loader)
 
virtual bool resetParameterFromSource (std::string param, SimComponent *cmpt)
 
virtual age_t removeAgeClass ()
 
virtual age_t addAgeClass ()
 
virtual age_t requiredAgeClass ()
 
- Public Member Functions inherited from LifeCycleEvent
 LifeCycleEvent (const char *name, const char *trait_link)
 Cstor. More...
 
virtual ~LifeCycleEvent ()
 
virtual void init (Metapop *popPtr)
 Sets the pointer to the current Metapop and the trait link if applicable. More...
 
virtual bool attach_trait (string trait)
 
virtual void set_paramset (std::string name, bool required, SimComponent *owner)
 
virtual void set_event_name (std::string &name)
 Set the name of the event (name of the ParamSet) and add the corresponding parameter to the set. More...
 
virtual void set_event_name (const char *name)
 
virtual string & get_event_name ()
 Accessor to the LCE's name. More...
 
virtual int get_rank ()
 Accessor to the LCE rank in the life cycle. More...
 
virtual void set_pop_ptr (Metapop *popPtr)
 Accessors for the population pointer. More...
 
virtual Metapopget_pop_ptr ()
 
- Public Member Functions inherited from SimComponent
 SimComponent ()
 
virtual ~SimComponent ()
 
virtual void loadUpdaters (UpdaterServices *loader)
 Loads the parameters and component updater onto the updater manager. More...
 
virtual void set_paramset (ParamSet *paramset)
 Sets the ParamSet member. More...
 
virtual void set_paramsetFromCopy (const ParamSet &PSet)
 Reset the set of parameters from a another set. More...
 
virtual ParamSetget_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 Paramget_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...
 

Additional Inherited Members

- Protected Attributes inherited from LifeCycleEvent
std::string _event_name
 The param name to be read in the init file. More...
 
Metapop_popPtr
 The ptr to the current Metapop. More...
 
std::string _LCELinkedTraitType
 The name of the linked trait. More...
 
int _LCELinkedTraitIndex
 The index in the individual's trait table of the linked trait. More...
 
- Protected Attributes inherited from SimComponent
ParamSet_paramSet
 The parameters container. More...
 

Detailed Description

Regulates the patches to their carrying capacity, acts on each age class separately.

Randomly removes individuals in each patch until each age class has reached the (sex-specific) carrying capacities of the patch.

Constructor & Destructor Documentation

◆ LCE_Regulation()

LCE_Regulation::LCE_Regulation ( )
inline
54: LifeCycleEvent("regulation","") {}
Base class of the Life Cycle Events, declares the LCE interface.
Definition: lifecycleevent.h:73

Referenced by clone().

+ Here is the caller graph for this function:

◆ ~LCE_Regulation()

virtual LCE_Regulation::~LCE_Regulation ( )
inlinevirtual
56{ }

Member Function Documentation

◆ addAgeClass()

virtual age_t LCE_Regulation::addAgeClass ( )
inlinevirtual

Implements LifeCycleEvent.

68{return NONE;}
#define NONE
No age flag.
Definition: types.h:48

References NONE.

◆ clone()

virtual LCE_Regulation * LCE_Regulation::clone ( )
inlinevirtual

Implements LifeCycleEvent.

63{return new LCE_Regulation();}
LCE_Regulation()
Definition: LCEmisc.h:54

References LCE_Regulation().

◆ execute()

void LCE_Regulation::execute ( )
virtual

Implements LifeCycleEvent.

92{
93#ifdef _DEBUG_
94 message("LCE_Regulation::execute (Patch nb: %i, offsprg: %i, adults: %i ",_popPtr->getPatchNbr()
96#endif
97 Patch* patch;
98
99 for(unsigned int i = 0; i < _popPtr->getPatchNbr(); i ++) {
100
101 patch = _popPtr->getPatch(i);
102
103 regulatePatch(patch, OFFSx, FEM);
104 regulatePatch(patch, OFFSx, MAL);
105 regulatePatch(patch, ADLTx, FEM);
106 regulatePatch(patch, ADLTx, MAL);
107
108 }
109
110#ifdef _DEBUG_
111 message("after: offsprg: %i, adults: %i)\n",_popPtr->size( OFFSPRG ), _popPtr->size( ADULTS ));
112#endif
113
114}
void regulatePatch(Patch *patch, age_idx age, sex_t sex)
Definition: LCEmisc.cc:118
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:81
unsigned int size()
Get the total number of individuals present in the population, all sex and age classes together.
Definition: metapop.h:310
unsigned int getPatchNbr()
Definition: metapop.h:276
Patch * getPatch(unsigned int i)
Patch accessor, return the ith+1 patch in the metapop.
Definition: metapop.h:257
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:430
void message(const char *message,...)
Definition: output.cc:40
@ FEM
Definition: types.h:37
@ MAL
Definition: types.h:37
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
@ OFFSx
Definition: types.h:42
@ ADLTx
Definition: types.h:42

References LifeCycleEvent::_popPtr, ADLTx, ADULTS, FEM, Metapop::getPatch(), Metapop::getPatchNbr(), MAL, message(), OFFSPRG, OFFSx, regulatePatch(), and Metapop::size().

◆ loadFileServices()

virtual void LCE_Regulation::loadFileServices ( FileServices loader)
inlinevirtual

Implements SimComponent.

64{}

◆ loadStatServices()

virtual void LCE_Regulation::loadStatServices ( StatServices loader)
inlinevirtual

Implements SimComponent.

65{}

◆ regulatePatch()

void LCE_Regulation::regulatePatch ( Patch patch,
age_idx  age,
sex_t  sex 
)
119{
120 unsigned int K = patch->get_K(sex);
121
122 while( patch->size(sex, age) > K )
123 _popPtr->recycle( patch->remove(sex, age, RAND::Uniform( patch->size(sex, age) ) ) );
124}
void recycle(Individual *ind)
Put an individual in the recycling pool.
Definition: indfactory.h:62
unsigned int get_K()
Definition: metapop.h:479
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:496
Individual * remove(sex_t SEX, age_idx AGE, unsigned int at)
Removes the individual sitting at the given index in the appropriate container.
Definition: metapop.h:573
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:125

References LifeCycleEvent::_popPtr, Patch::get_K(), IndFactory::recycle(), Patch::remove(), Patch::size(), and RAND::Uniform().

Referenced by execute().

+ Here is the caller graph for this function:

◆ removeAgeClass()

virtual age_t LCE_Regulation::removeAgeClass ( )
inlinevirtual

Implements LifeCycleEvent.

67{return NONE;}

References NONE.

◆ requiredAgeClass()

virtual age_t LCE_Regulation::requiredAgeClass ( )
inlinevirtual

Implements LifeCycleEvent.

69{return NONE;}

References NONE.

◆ resetParameterFromSource()

virtual bool LCE_Regulation::resetParameterFromSource ( std::string  param,
SimComponent cmpt 
)
inlinevirtual

Implements SimComponent.

66{return false;}

◆ setParameters()

virtual bool LCE_Regulation::setParameters ( )
inlinevirtual

Implements SimComponent.

61{return true;}

The documentation for this class was generated from the following files:

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