FIMS  v0.11.0
Loading...
Searching...
No Matches
fleet.hpp
Go to the documentation of this file.
1
9#ifndef FIMS_POPULATION_DYNAMICS_FLEET_HPP
10#define FIMS_POPULATION_DYNAMICS_FLEET_HPP
11
18
19namespace fims_popdy {
20
25template <class Type>
26struct Fleet : public fims_model_object::FIMSObject<Type> {
27 static uint32_t id_g;
28 size_t n_years;
29 size_t n_ages;
30 size_t n_lengths;
35
36 // selectivity
38 std::shared_ptr<SelectivityBase<Type>>
40
41 // age-to-length conversion model
42 std::shared_ptr<AgeToLengthConversionBase<Type>>
46 false;
48
49 // catch data
51 std::shared_ptr<fims_data_object::DataObject<Type>>
53
55
56 // index data
58 std::shared_ptr<fims_data_object::DataObject<Type>>
60
62
63 // age comp data
65 std::shared_ptr<fims_data_object::DataObject<Type>>
67
68 // length comp data
70 std::shared_ptr<fims_data_object::DataObject<Type>>
72
73 // Mortality and catchability
78
81 q;
82
101 this->id = Fleet::id_g++;
102 this->register_self(this->id);
103 }
104
107 virtual ~Fleet() {}
108
115 void Prepare() {
116 // for(size_t fleet_ = 0; fleet_ <= this->n_fleets; fleet_++) {
117 // this -> Fmort[fleet_] = fims_math::exp(this -> log_Fmort[fleet_]);
118
119 for (size_t i = 0; i < this->log_q.size(); i++) {
120 this->q[i] = fims_math::exp(this->log_q[i]);
121 }
122
123 for (size_t year = 0; year < this->n_years; year++) {
124 this->Fmort[year] = fims_math::exp(this->log_Fmort[year]);
125 }
126 }
127};
128
129// default id of the singleton fleet class
130template <class Type>
131uint32_t Fleet<Type>::id_g = 0;
132
133} // end namespace fims_popdy
134
135#endif /* FIMS_POPULATION_DYNAMICS_FLEET_HPP */
Declares the AgeToLengthConversionBase class which is the base class for all age-length key functors.
Definition fims_vector.hpp:27
Sets up a data class to create a generic data object with up to five dimensions. The class contains i...
This distributions module includes any .hpp files within the subfolders so that only this file needs ...
Establishes the FIMS Vector class.
Definition of the FIMSObject structure.
The population dynamics of FIMS.
Definition catch_at_age.hpp:45
Includes any .hpp files within the subfolders so that only this file needs to included in include sta...
void register_self(const uint32_t id)
Registers a FIMSObject instance with the memory tracker.
Definition model_object.hpp:35
FIMSObject struct that defines member types and returns the unique id.
Definition model_object.hpp:55
Fleet()
Constructor.
Definition fleet.hpp:100
fims::Vector< Type > log_q
Definition fleet.hpp:77
std::shared_ptr< SelectivityBase< Type > > selectivity
Definition fleet.hpp:39
int fleet_observed_lengthcomp_data_id_m
Definition fleet.hpp:69
std::string observed_catch_units
Definition fleet.hpp:54
int fleet_selectivity_id_m
Definition fleet.hpp:37
std::shared_ptr< fims_data_object::DataObject< Type > > observed_agecomp_data
Definition fleet.hpp:66
fims::Vector< Type > ageing_error
Ageing error matrices, 1 for all years or 1 per year, with true age as rows and observed age varying ...
Definition fleet.hpp:90
size_t n_years
Definition fleet.hpp:28
int fleet_observed_agecomp_data_id_m
Definition fleet.hpp:64
fims::Vector< Type > weight_at_age
Weight at age for this fleet's catch and index weight, ordered by year and then age....
Definition fleet.hpp:96
std::shared_ptr< fims_data_object::DataObject< Type > > observed_index_data
Definition fleet.hpp:59
fims::Vector< Type > Fmort
Definition fleet.hpp:79
void Prepare()
Prepare to run the fleet module. Called at each model iteration, and used to exponentiate the natural...
Definition fleet.hpp:115
size_t n_ages
Definition fleet.hpp:29
virtual ~Fleet()
Destructor.
Definition fleet.hpp:107
bool requires_age_length_mapping
Definition fleet.hpp:45
fims::Vector< Type > q
Definition fleet.hpp:81
std::shared_ptr< fims_data_object::DataObject< Type > > observed_lengthcomp_data
Definition fleet.hpp:71
fims::Vector< Type > age_to_length_conversion
Definition fleet.hpp:83
int fleet_observed_index_data_id_m
Definition fleet.hpp:57
std::shared_ptr< AgeToLengthConversionBase< Type > > age_to_length_conversion_model
Definition fleet.hpp:43
fims::Vector< Type > log_Fmort
Definition fleet.hpp:75
std::shared_ptr< fims_data_object::DataObject< Type > > observed_catch_data
Definition fleet.hpp:52
fims::Vector< double > length_bin_edges
Definition fleet.hpp:34
fims::Vector< double > lengths
Definition fleet.hpp:32
size_t n_lengths
Definition fleet.hpp:30
int fleet_observed_catch_data_id_m
Definition fleet.hpp:50
std::string observed_index_units
Definition fleet.hpp:61