FIMS  v0.9.3
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"
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.
39
40 virtual ~SRBevertonHolt() {}
41
49 virtual const Type evaluate_mean(const Type& spawners, const Type& phi_0) {
51 Type steep;
52 Type steep_lo = static_cast<Type>(0.2);
53 Type steep_hi = static_cast<Type>(1.0);
54 Type rzero;
55
56 // Transform input parameters
57 steep = fims_math::inv_logit(steep_lo, steep_hi, this->logit_steep[0]);
58 rzero = fims_math::exp(this->log_rzero[0]);
59
60 recruits = (static_cast<Type>(0.8) * rzero * steep * spawners) /
61 (static_cast<Type>(0.2) * phi_0 * rzero *
62 (static_cast<Type>(1.0) - steep) +
63 spawners * (steep - static_cast<Type>(0.2)));
64
65 return recruits;
66 }
67
71 virtual const Type evaluate_process(size_t pos) { return 0; }
72};
73
74} // namespace fims_popdy
75
76#endif /* FIMS_POPULATION_DYNAMICS_RECRUITMENT_SR_BEVERTON_HOLT_HPP */
Definition fims_vector.hpp:27
Establishes the FIMS Vector class.
The population dynamics of FIMS.
Definition catch_at_age.hpp:41
void clear_internal()
Clears the internal objects.
Definition rcpp_interface.hpp:235
Serves as the parent class where recruitment functions are called.
Base class for all recruitment functors.
Definition recruitment_base.hpp:27
fims::Vector< Type > log_rzero
Definition recruitment_base.hpp:35
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:71
virtual const Type evaluate_mean(const Type &spawners, const Type &phi_0)
Evaluates expected recruitment from the stock–recruitment relationship before recruitment-process dev...
Definition sr_beverton_holt.hpp:49