FIMS  v0.8.0
Loading...
Searching...
No Matches
logistic.hpp
Go to the documentation of this file.
1
9#ifndef POPULATION_DYNAMICS_SELECTIVITY_LOGISTIC_HPP
10#define POPULATION_DYNAMICS_SELECTIVITY_LOGISTIC_HPP
11
12// #include "../../../interface/interface.hpp"
13#include "../../../common/fims_math.hpp"
14#include "../../../common/fims_vector.hpp"
15#include "selectivity_base.hpp"
16
17namespace fims_popdy {
18
29template <typename Type>
30struct LogisticSelectivity : public SelectivityBase<Type> {
40
41 virtual ~LogisticSelectivity() {}
42
57 virtual const Type evaluate(const Type &x) {
58 return fims_math::logistic<Type>(inflection_point[0], slope[0], x);
59 }
60
65 virtual const Type evaluate(const Type &x, size_t pos) {
66 return fims_math::logistic<Type>(inflection_point.get_force_scalar(pos),
67 slope.get_force_scalar(pos), x);
68 }
69
71 std::map<std::string, fims::Vector<fims::Vector<Type>>> &report_vectors) {
72 report_vectors["inflection_point"].emplace_back(inflection_point);
73 report_vectors["slope"].emplace_back(slope);
74 }
75
77 std::map<std::string, size_t> &report_vector_count) {
78 report_vector_count["inflection_point"] += 1;
79 report_vector_count["slope"] += 1;
80 }
81};
82
83} // namespace fims_popdy
84
85#endif /* POPULATION_DYNAMICS_SELECTIVITY_LOGISTIC_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:279
Declares the SelectivityBase class which is the base class for all selectivity functors.
LogisticSelectivity class that returns the logistic function value from fims_math.
Definition logistic.hpp:30
fims::Vector< Type > slope
Definition logistic.hpp:34
virtual const Type evaluate(const Type &x)
Method of the logistic selectivity class that implements the logistic function from FIMS math.
Definition logistic.hpp:57
virtual const Type evaluate(const Type &x, size_t pos)
Method of the logistic selectivity class that implements the logistic function from FIMS math.
Definition logistic.hpp:65
virtual void get_report_vector_count(std::map< std::string, size_t > &report_vector_count)
Get the report vector count object. used to get the length of each report vector for populating the U...
Definition logistic.hpp:76
fims::Vector< Type > inflection_point
Definition logistic.hpp:32
virtual void create_report_vectors(std::map< std::string, fims::Vector< fims::Vector< Type > > > &report_vectors)
Create a map of report vectors for the object. used to populate the report_vectors map in FisheryMode...
Definition logistic.hpp:70
Base class for all selectivity functors.
Definition selectivity_base.hpp:24