FIMS  v0.8.0
Loading...
Searching...
No Matches
ewaa.hpp
Go to the documentation of this file.
1
9#ifndef POPULATION_DYNAMICS_GROWTH_EWAA_HPP
10#define POPULATION_DYNAMICS_GROWTH_EWAA_HPP
11
12// #include "../../../interface/interface.hpp"
13#include <map>
14
15#include "growth_base.hpp"
16
17namespace fims_popdy {
18
22template <typename Type>
23struct EWAAGrowth : public GrowthBase<Type> {
24 // add submodule class members here
25 // these include parameters of the submodule
26 // a map looks up values based on a reference key
27 // in this case, our key is age (first double), and
28 // the value is the weight at that age (second double)
29 std::map<double, double> ewaa;
31 typedef typename std::map<double, double>::iterator
34 EWAAGrowth() : GrowthBase<Type>() {}
35
36 virtual ~EWAAGrowth() {}
37
43 virtual const Type evaluate(const double& a) {
44 weight_iterator it = this->ewaa.find(a);
45 if (it == this->ewaa.end()) {
46 return 0.0;
47 }
48 Type ret = (*it).second; // itewaa[a];
49 return ret;
50 }
51
56 std::map<std::string, fims::Vector<fims::Vector<Type>>>& report_vectors) {
57 // fims::Vector<Type> ewaa_vector;
58 // for (auto const& pair : ewaa) {
59 // ewaa_vector.push_back(pair.second);
60 // }
61 // report_vectors["ewaa"] = ewaa_vector;
62 }
63};
64} // namespace fims_popdy
65#endif /* POPULATION_DYNAMICS_GROWTH_EWAA_HPP */
Definition fims_vector.hpp:27
Declares the GrowthBase class which is the base class for all growth functors.
The population dynamics of FIMS.
Definition catch_at_age.hpp:41
void clear_internal()
Clears the internal objects.
Definition rcpp_interface.hpp:279
EWAAGrowth class that returns the EWAA function value.
Definition ewaa.hpp:23
virtual const Type evaluate(const double &a)
Returns the weight at age a (in kg) from the input vector.
Definition ewaa.hpp:43
std::map< double, double > ewaa
Definition ewaa.hpp:29
std::map< double, double >::iterator weight_iterator
Definition ewaa.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 growth object.
Definition ewaa.hpp:55
Base class for all growth functors.
Definition growth_base.hpp:24