FIMS  v0.8.1
Loading...
Searching...
No Matches
sr_beverton_holt.hpp
Go to the documentation of this file.
1
10#ifndef FIMS_POPULATION_DYNAMICS_RECRUITMENT_SR_BEVERTON_HOLT_HPP
11#define FIMS_POPULATION_DYNAMICS_RECRUITMENT_SR_BEVERTON_HOLT_HPP
12
13#include "recruitment_base.hpp"
14#include "../../../common/fims_vector.hpp"
15
16namespace fims_popdy {
17
27template <typename Type>
28struct SRBevertonHolt : public RecruitmentBase<Type> {
29 // Here we define the members that will be used in the Beverton--Holt
30 // stock--recruitment function. These members are needed by the Beverton--Holt
31 // stock--recruitment function but will not be common to all recruitment
32 // functions like spawners is below.
39
40 virtual ~SRBevertonHolt() {}
41
51 virtual const Type evaluate_mean(const Type& spawners, const Type& phi_0) {
53 Type steep;
54 Type steep_lo = static_cast<Type>(0.2);
55 Type steep_hi = static_cast<Type>(1.0);
56 Type rzero;
57
58 // Transform input parameters
59 steep = fims_math::inv_logit(steep_lo, steep_hi, this->logit_steep[0]);
60 rzero = fims_math::exp(this->log_rzero[0]);
61
62 recruits = (static_cast<Type>(0.8) * rzero * steep * spawners) /
63 (static_cast<Type>(0.2) * phi_0 * rzero *
64 (static_cast<Type>(1.0) - steep) +
65 spawners * (steep - static_cast<Type>(0.2)));
66
67 return recruits;
68 }
69
73 virtual const Type evaluate_process(size_t pos) { return 0; }
74};
75
76} // namespace fims_popdy
77
78#endif /* FIMS_POPULATION_DYNAMICS_RECRUITMENT_SR_BEVERTON_HOLT_HPP */
Definition fims_vector.hpp:27
The population dynamics of FIMS.
Definition catch_at_age.hpp:41
void clear_internal()
Clears the internal objects.
Definition rcpp_interface.hpp:239
Serves as the parent class where recruitment functions are called.
Base class for all recruitment functors.
Definition recruitment_base.hpp:28
fims::Vector< Type > log_rzero
Definition recruitment_base.hpp:36
BevertonHolt class that returns the Beverton–Holt stock–recruitment from fims_math.
Definition sr_beverton_holt.hpp:28
fims::Vector< Type > logit_steep
Definition sr_beverton_holt.hpp:33
virtual const Type evaluate_process(size_t pos)
Definition sr_beverton_holt.hpp:73
virtual const Type evaluate_mean(const Type &spawners, const Type &phi_0)
Beverton–Holt implementation of the stock–recruitment function.
Definition sr_beverton_holt.hpp:51