Nemo  2.3.46
LCE_Aging Class Reference

Removes all adults from the patches and randomly moves the offspring to the adults age class. More...

#include <LCEmisc.h>

+ Inheritance diagram for LCE_Aging:
+ Collaboration diagram for LCE_Aging:

Public Member Functions

 LCE_Aging ()
 
virtual ~LCE_Aging ()
 
virtual bool setParameters ()
 
virtual void execute ()
 
virtual LCE_Agingclone ()
 
virtual void loadFileServices (FileServices *loader)
 
virtual void loadStatServices (StatServices *loader)
 
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...
 

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

Removes all adults from the patches and randomly moves the offspring to the adults age class.

Patch regulation is performed at the same time, leaving the patch at carrying capacity (if enough offspring individuals were present). This is the only LCE that actually removes the adults from the patches. Also checks whether the patch is filled and sets the extinction flag accordingly.

Constructor & Destructor Documentation

LCE_Aging::LCE_Aging ( )
inline

Referenced by clone().

82 : LifeCycleEvent("aging","") {}
LifeCycleEvent(const char *name, const char *trait_link)
Cstor.
Definition: lifecycleevent.h:98
virtual LCE_Aging::~LCE_Aging ( )
inlinevirtual
84 { }

Member Function Documentation

virtual age_t LCE_Aging::addAgeClass ( )
inlinevirtual

Implements LifeCycleEvent.

References ADULTS.

93 {return ADULTS;}
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
virtual LCE_Aging* LCE_Aging::clone ( )
inlinevirtual

Implements LifeCycleEvent.

References LCE_Aging().

89 {return new LCE_Aging();}
LCE_Aging()
Definition: LCEmisc.h:82
void LCE_Aging::execute ( )
virtual

Implements LifeCycleEvent.

References LifeCycleEvent::_popPtr, ADLTx, ADULTS, FEM, Patch::flush(), Patch::get_age(), Patch::get_KFem(), Patch::get_KMal(), Metapop::getPatch(), Metapop::getPatchNbr(), MAL, message(), Patch::move(), OFFSPRG, OFFSx, Patch::set_age(), Patch::set_isExtinct(), Metapop::size(), Patch::size(), and RAND::Uniform().

46 {
47 #ifdef _DEBUG_
48  message("LCE_Aging::execute (Patch nb: %i offsprg nb: %d adlt nb: %d; ",_popPtr->getPatchNbr()
50 #endif
51  unsigned int nbInd = 0;
52  Patch *patch;
53  for(unsigned int i = 0; i < _popPtr->getPatchNbr(); i++) {
54 
55  patch = _popPtr->getPatch(i);
56 
57  patch->flush(ADLTx, _popPtr);
58 
59  nbInd = 0;
60 
61  while(nbInd++ < patch->get_KFem() && patch->size(FEM, OFFSx) != 0)
62  patch->move(FEM, OFFSx, ADLTx, RAND::Uniform( patch->size(FEM, OFFSx) ) );
63 
64  nbInd = 0;
65 
66  while(nbInd++ < patch->get_KMal() && patch->size(MAL, OFFSx) != 0)
67  patch->move(MAL, OFFSx, ADLTx, RAND::Uniform( patch->size(MAL, OFFSx) ) );
68 
69  patch->flush(OFFSx, _popPtr);
70 
71  //set the Patch extinction and age tags:
72  if(patch->size(ADULTS) == 0) {
73  patch->set_isExtinct(true);
74  patch->set_age(0);
75  } else {
76  patch->set_isExtinct(false);
77  patch->set_age( patch->get_age() + 1 );
78  }
79  }
80 #ifdef _DEBUG_
81  message("after: %i)\n",_popPtr->size( ));
82 #endif
83 }
void message(const char *message,...)
Definition: output.cc:40
unsigned int get_KMal()
Definition: metapop.h:473
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
void move(sex_t SEX, age_idx from, age_idx to, unsigned int at)
Moves an individual from an age class to an other one.
Definition: metapop.h:587
void flush(sex_t SEX, age_idx AGE, Metapop *pop)
Removes all individual pointers of the appropriate sex and age class and flush them into the recyclin...
Definition: metapop.h:634
unsigned int get_KFem()
Definition: metapop.h:472
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:487
Second class in the metapopulation design structure, between the Metapop and Individual classes...
Definition: metapop.h:421
Patch * getPatch(unsigned int i)
Patch accessor, return the ith+1 patch in the metapop.
Definition: metapop.h:251
unsigned int getPatchNbr()
Definition: metapop.h:270
unsigned int get_age()
Definition: metapop.h:476
Definition: types.h:42
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:101
Definition: types.h:37
void set_age(unsigned int a)
Definition: metapop.h:464
Definition: types.h:42
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
void set_isExtinct(bool status)
Definition: metapop.h:463
unsigned int size()
Get the total number of individuals present in the population, all sex and age classes together...
Definition: metapop.h:302
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:81
Definition: types.h:37
virtual void LCE_Aging::loadFileServices ( FileServices loader)
inlinevirtual

Implements SimComponent.

90 {}
virtual void LCE_Aging::loadStatServices ( StatServices loader)
inlinevirtual

Implements SimComponent.

91 {}
virtual age_t LCE_Aging::removeAgeClass ( )
inlinevirtual

Implements LifeCycleEvent.

References OFFSPRG.

92 {return OFFSPRG;}
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
virtual age_t LCE_Aging::requiredAgeClass ( )
inlinevirtual

Implements LifeCycleEvent.

References OFFSPRG.

94 {return OFFSPRG;}
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
virtual bool LCE_Aging::setParameters ( )
inlinevirtual

Implements SimComponent.

87 {return true;}

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

Generated for Nemo v2.3.0 by  doxygen 1.8.8 --
Catalogued on GSR