FIMS  v0.11.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 "common/fims_math.hpp"
14#include "selectivity_base.hpp"
15
16namespace fims_popdy {
17
28template <typename Type>
29struct LogisticSelectivity : public SelectivityBase<Type> {
43
45
46 virtual ~LogisticSelectivity() {}
47
62 virtual const Type evaluate(const Type &x) {
63 return fims_math::logistic<Type>(inflection_point[0], slope[0], x);
64 }
65
72 virtual const Type evaluate(const Type &x, size_t pos) {
73 return fims_math::logistic<Type>(inflection_point.get_force_scalar(pos),
74 slope.get_force_scalar(pos), x);
75 }
76};
77
78} // namespace fims_popdy
79
80#endif /* POPULATION_DYNAMICS_SELECTIVITY_LOGISTIC_HPP */
Definition fims_vector.hpp:27
A collection of mathematical functions used in FIMS.
Establishes the FIMS Vector class.
The population dynamics of FIMS.
Definition catch_at_age.hpp:45
std::shared_ptr< AgeToLengthConversionBase< Type > > BuildAgeToLengthConversionFleet(const std::shared_ptr< Population< Type > > &population, const std::shared_ptr< Fleet< Type > > &fleet)
Build the active age-to-length conversion for a fleet from the current population and fleet state.
Definition runtime.hpp:44
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:29
fims::Vector< Type > slope
How quickly selectivity changes with age around the inflection point, per year of age....
Definition logistic.hpp:42
virtual const Type evaluate(const Type &x)
Method of the logistic selectivity class that implements the logistic function from FIMS math.
Definition logistic.hpp:62
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:72
fims::Vector< Type > inflection_point
The age at which 50% of fish are selected for models that start at age zero and each age bin represen...
Definition logistic.hpp:36
Base class for all selectivity functors.
Definition selectivity_base.hpp:24