From e6fcd2836a5e78ff06537829f91843d06c21f9f0 Mon Sep 17 00:00:00 2001 From: Andrea-Havron-NOAA <85530309+Andrea-Havron-NOAA@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:16:41 +0000 Subject: [PATCH] fix bugs --- inst/include/population_dynamics/fleet/fleet.hpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/inst/include/population_dynamics/fleet/fleet.hpp b/inst/include/population_dynamics/fleet/fleet.hpp index 504946d2..817ce57b 100644 --- a/inst/include/population_dynamics/fleet/fleet.hpp +++ b/inst/include/population_dynamics/fleet/fleet.hpp @@ -154,13 +154,7 @@ struct Fleet : public fims_model_object::FIMSObject { } } - virtual const Type evaluate_age_comp() { - std::vector dims; - dims.resize(2); - dims[0] = this->x->get_imax(); - dims[1] = this->x->get_jmax(); - - + virtual void const Type evaluate_age_comp() { for (size_t y = 0; y < this->nyears; y++) { Type sum = 0.0; for (size_t a = 0; a < this->nages; a++) { @@ -168,6 +162,7 @@ struct Fleet : public fims_model_object::FIMSObject { sum += this->catch_numbers_at_age[i_age_year]; } for (size_t a = 0; a < this->nages; a++) { + size_t i_age_year = y * this->nages + a; this->catch_numbers_at_age[i_age_year] = this->catch_numbers_at_age[i_age_year] / sum; @@ -175,8 +170,10 @@ struct Fleet : public fims_model_object::FIMSObject { } } - virtual const Type evaluate_index() { - expected_index[i] = log(this->expected_index[i]); + virtual void const Type evaluate_index() { + for(size_t i=0; iexpected_index.size(); i++){ + expected_index[i] = log(this->expected_index[i]); + } } };