FIMS  v0.8.0
Loading...
Searching...
No Matches
maturity_base.hpp
Go to the documentation of this file.
1
11#ifndef POPULATION_DYNAMICS_MATURITY_BASE_HPP
12#define POPULATION_DYNAMICS_MATURITY_BASE_HPP
13
14#include "../../../common/model_object.hpp"
15
16namespace fims_popdy {
17
23template <typename Type>
25 // id_g is the ID of the instance of the MaturityBase class.
26 // this is like a memory tracker.
27 // Assigning each one its own ID is a way to keep track of
28 // all the instances of the MaturityBase class.
29 static uint32_t id_g;
34 // increment id of the singleton maturity class
35 this->id = MaturityBase::id_g++;
36 }
37
43 virtual const Type evaluate(const Type& x) = 0;
50 virtual const Type evaluate(const Type& x, size_t pos) = 0;
51};
52
53// default id of the singleton maturity class
54template <typename Type>
56
57} // namespace fims_popdy
58
59#endif /* POPULATION_DYNAMICS_MATURITY_BASE_HPP */
The population dynamics of FIMS.
Definition catch_at_age.hpp:41
void clear_internal()
Clears the internal objects.
Definition rcpp_interface.hpp:279
FIMSObject struct that defines member types and returns the unique id.
Definition model_object.hpp:25
Base class for all maturity functors.
Definition maturity_base.hpp:24
virtual const Type evaluate(const Type &x)=0
Calculates the maturity.
static uint32_t id_g
Definition maturity_base.hpp:29
virtual const Type evaluate(const Type &x, size_t pos)=0
Calculates the selectivity.
MaturityBase()
Constructor.
Definition maturity_base.hpp:33