Skip to content

Default parameter table matrix values return non-numeric values #123

Description

@efletcherPIFSC

Loading a minimal AGEPRO input model (saving a agepro_inp_model via create_agepro_model and loag

# dev-runAgePro branch
test <- create_agepro_model()
#Replace NULL Recruitment with Beverton-Holt Model 5
test$set_recruit_model(5) 
test$write_inp("untitled1.INP") 
rm(test)
test <- import_agepro_model("untitled.INP")
✔ Agepro Model Initialized
Use the File Dialog Window to open a file ...AGEPRO Model Projection analyses type set to standardline 1:Version: 'AGEPRO VERSION 4.25'line 2: [CASEID]
→ Line 3: CASE ID: Unnamed AGEPRO modelline 4: [GENERAL]
→ Line 4 : Reading AGEPRO model GENERAL options ...
  ℹ yr_start (First Year in Projection): 0
  ℹ yr_end (Last Year in Projection): 2
  ℹ age_begin (First Age Class): 1
  ℹ age_end (Last Age Class): 6
  ℹ num_pop_sims (Number of Population Simulations): 1000
  ℹ num_fleets (Number of Fleets): 1
  ℹ num_rec_models (Number of Recruitment Model(s)): 1
  ℹ discards_present (Discards are present): FALSE 
  ℹ seed (Calculation Engine Random Number Seed): 89115292line 5: [BOOTSTRAP]
→ Line 6:num_bootstraps: 0
  ℹ pop_scale_factor (BootFac): 0Line 7: bootstrap_file: "[STOCK_WEIGHT]"line 8: 0  1
Input line 8 does not match AGEPRO keyword parameterline 9: NA  NA  NA  NA  NA  NA
Input line 9 does not match AGEPRO keyword parameterline 10: NA  NA  NA  NA  NA  NA
Input line 10 does not match AGEPRO keyword parameterline 11: NA  NA  NA  NA  NA  NA
Input line 11 does not match AGEPRO keyword parameterline 12: NA  NA  NA  NA  NA  NA
Input line 12 does not match AGEPRO keyword parameterline 13: [SSB_WEIGHT]
→ Reading ssb_weight: Spawning Stock Weight of AgeLine 14:input_option: 0 (Read from input data)
  ℹ time_varying: TRUEThere was an error reading this file. 
Error in read_inp_numeric_line(inp_con): Line contains a Non Numeric SubstringNA, NA, NA, NA, NA, NAClosing connection to file.
Warning message:
'[STOCK_WEIGHT]' is an invalid path or doesn't exist in working directory. 
Please save AGEPRO input files with a vaild bootstrap_file, especially with running models with the calculation engine. 

When creating Parameter Table and CV Tables for Process Error and Harvest/Projection Analyses keyword parameters, non-numeric NA values are created by default.

create_parameter_table = function(fleet_yr_rows, ages_cols) {
return(matrix(rep(NA, (fleet_yr_rows * ages_cols) ) ,
nrow = fleet_yr_rows,
ncol = ages_cols))
},

Todo:

Resolution

Converting default NA values to 0 will resolve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeature: Process ErrorFor parameters with stochastic propertiesfeature: Projection Analyses - HarvestRelated to Harvest Scenario or the Projection Analyses Types: Standard, Pstar, or Rebuild

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions