PIFSCstockassessments / ageproR

Prototype R package interface for AGEPRO (Age Structure Projection Model) using the JSON data format.
GNU General Public License v3.0
1 stars 0 forks source link

`set_recruit_models` do not affect recruit probability and number of recruitment models #39

Closed efletcherPIFSC closed 5 months ago

efletcherPIFSC commented 6 months ago

Issue

Setting a new recruit model via set_recruit_model does not affect the existing harvest_specifications.

Replication

  1. create new agepro_model with 2 or more number of recruit models and assign it to value. For this example, we are assigning a new agepro_model with 3 recruitment models to test.
    > test <- agepro_model$new(2019,2026,1,32,1000,4,3)
    ══ general ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════
    • First Year in Projection: 2019
    • Last Year in Projection: 2026
    • First Age Class: 1
    • Last Age Class: 32
    • Number of Population Simulations: 1000
    • Number of Fleets: 4
    • Number of Recruitment Model(s): 3
    • Discards are present: FALSE
    • Calculation Engine Random Number Seed: 40803224
    [snipped rest of output]
  2. Check its recruitment value of test using test$recruit. Recrcuitment Probablity is divided to 3 list items. Recruit data in list listed as 3 items.
    
    > test$recruit
    ℹ 3 recruitment models for 8 years.
    • Recruitment Scaling Factor: 1000
    • SSB Scaling Factor: 0

ℹ Recruitment Probability: [[1]] 2019 2020 2021 2022 2023 2024 2025 2026 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125

[[2]] 2019 2020 2021 2022 2023 2024 2025 2026 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125

[[3]] 2019 2020 2021 2022 2023 2024 2025 2026 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125

ℹ Recruit Data in recruitment's model collection list: ℹ Recruit 1 of 3 : Recruitment Model #0 NULL Recruitment ! Replace with a valid recruitment model before processing to AGEPRO calcualtion engine

ℹ Recruit 2 of 3 : Recruitment Model #0 NULL Recruitment ! Replace with a valid recruitment model before processing to AGEPRO calcualtion engine

ℹ Recruit 3 of 3 : Recruitment Model #0 NULL Recruitment ! Replace with a valid recruitment model before processing to AGEPRO calcualtion engine

3. Use 'test' agepro model function `set_recruit_model` to create a single recruitment model 14 (Empirical CDF). The output will show new single recruitment data model, but shows the same 3 recruitment Probability list items

test$set_recruit_model(14) ══ recruit ════════════════════════════════════════════════════════════════════════════════════════════════════════ → Recruitment Data Setup → Using Model Number 14 ℹ 1 recruitment model for 8 years. • Recruitment Scaling Factor: 1000 • SSB Scaling Factor: 0

ℹ Recruitment Probability: [[1]] 2019 2020 2021 2022 2023 2024 2025 2026 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125

[[2]] 2019 2020 2021 2022 2023 2024 2025 2026 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125

[[3]] 2019 2020 2021 2022 2023 2024 2025 2026 0.125 0.125 0.125 0.125 0.125 0.125 0.125 0.125

ℹ Recruit Data in recruitment's model collection list: ℹ Recruit 1 of 1 : Recruitment Model #14 ℹ Empirical Cumulative Distribution Function of Recruitment • Has SSB? FALSE • Number of Recruitment Data Points: 2 ℹ Observations:

A tibble: 2 × 1

recruit
  <dbl>

1 0 2 0

4. general options of `test` remain the same

test$general • First Year in Projection: 2019 • Last Year in Projection: 2026 • First Age Class: 1 • Last Age Class: 32 • Number of Population Simulations: 1000 • Number of Fleets: 4 • Number of Recruitment Model(s): 3 • Discards are present: FALSE • Calculation Engine Random Number Seed: 40803224

Questions

Solution