FIMS  v0.8.0
Loading...
Searching...
No Matches
population.hpp
Go to the documentation of this file.
1
8#ifndef FIMS_POPULATION_DYNAMICS_POPULATION_HPP
9#define FIMS_POPULATION_DYNAMICS_POPULATION_HPP
10
11#include "../../common/model_object.hpp"
12#include "../fleet/fleet.hpp"
13#include "../growth/growth.hpp"
14#include "../recruitment/recruitment.hpp"
15#include "../../interface/interface.hpp"
16#include "../maturity/maturity.hpp"
17
18namespace fims_popdy {
19
24template <typename Type>
26 static uint32_t id_g;
27 size_t n_years;
28 size_t n_ages;
29 size_t n_fleets;
31 // parameters are estimated; after initialize in create_model, push_back to
32 // parameter list - in information.hpp (same for initial F in fleet)
38 1, static_cast<Type>(0.5));
44 // Transformed values
53 int recruitment_id = -999;
54 std::shared_ptr<fims_popdy::RecruitmentBase<Type>>
57 // growth
58 int growth_id = -999;
59 std::shared_ptr<fims_popdy::GrowthBase<Type>>
62 // maturity
63 int maturity_id = -999;
64 std::shared_ptr<fims_popdy::MaturityBase<Type>>
67 // fleet
68 std::set<uint32_t> fleet_ids;
69 std::vector<std::shared_ptr<fims_popdy::Fleet<Type>>>
75 Population() { this->id = Population::id_g++; }
76
81 std::map<std::string, fims::Vector<fims::Vector<Type>>>& report_vectors) {
82 report_vectors["log_init_naa"].emplace_back(this->log_init_naa);
83 report_vectors["log_M"].emplace_back(this->log_M);
84 report_vectors["log_f_multiplier"].emplace_back(this->log_f_multiplier);
85 report_vectors["spawning_biomass_ratio"].emplace_back(
86 this->spawning_biomass_ratio);
87 }
88
93 std::map<std::string, size_t>& report_vector_count) {
94 report_vector_count["log_init_naa"] += 1;
95 report_vector_count["log_M"] += 1;
96 report_vector_count["log_f_multiplier"] += 1;
97 report_vector_count["spawning_biomass_ratio"] += 1;
98 }
99};
100template <class Type>
102
103} // namespace fims_popdy
104
105#endif /* FIMS_POPULATION_DYNAMICS_POPULATION_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
FIMSObject struct that defines member types and returns the unique id.
Definition model_object.hpp:25
Population class. Contains subpopulations that are divided into generic partitions (e....
Definition population.hpp:25
fims::Vector< double > ages
Definition population.hpp:49
virtual void get_report_vector_count(std::map< std::string, size_t > &report_vector_count)
Get the report vector count object.
Definition population.hpp:92
size_t n_fleets
Definition population.hpp:29
int growth_id
Definition population.hpp:58
fims::Vector< Type > log_M
Definition population.hpp:36
std::shared_ptr< fims_popdy::MaturityBase< Type > > maturity
Definition population.hpp:65
std::vector< std::shared_ptr< fims_popdy::Fleet< Type > > > fleets
Definition population.hpp:70
fims::Vector< Type > log_f_multiplier
Definition population.hpp:39
fims::Vector< Type > spawning_biomass_ratio
Definition population.hpp:41
int recruitment_id
recruitment
Definition population.hpp:53
std::shared_ptr< fims_popdy::RecruitmentBase< Type > > recruitment
Definition population.hpp:55
static uint32_t id_g
Definition population.hpp:26
size_t n_years
Definition population.hpp:27
fims::Vector< Type > f_multiplier
Definition population.hpp:46
int maturity_id
Definition population.hpp:63
size_t n_ages
Definition population.hpp:28
std::set< uint32_t > fleet_ids
Definition population.hpp:68
Population()
Constructor.
Definition population.hpp:75
fims::Vector< Type > M
Definition population.hpp:45
fims::Vector< Type > proportion_female
Definition population.hpp:37
fims::Vector< double > years
Definition population.hpp:50
fims::Vector< Type > log_init_naa
Definition population.hpp:34
std::shared_ptr< fims_popdy::GrowthBase< Type > > growth
Definition population.hpp:60
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.
Definition population.hpp:80