Issue
There are a couple of issues that ageproR that will need to handle with "Loading AGEPRO input file to program" workload
- Inconsistent User-experience compared with AGEPRO-GUI's method of loading a AGEPRO input files:
a. AGEPRO-GUI is straightforward with menu + file-dialog.
b. ageproR requires a new instance of agepro_inp_model, before loading a AGEPRO input file
- Using
R6Class nomenclature (agepro_model$initialize()) to create or create to load Agepro Models classes may be a usability road block.
- Initializing
agepro_inp_model with user-specified values for keyword parameters will be overwritten by the imported AGEPRO input file.
a. If the intention to use agepro_inp_model load from and save to AGEPRO Input Files, Should agepro_inp_model be used for creating new AGEPRO model cases since it will be needed to be saved to file?
Detail
Creating new agepro models in agerproR is similar to AGEPRO-GUI's workflow. But loading AGEPRO input files to ageproR is different to AGEPRO GUI.
AGEPRO-GUI
Creating a new AGEPRO model
- Set valid values for First Year of Projection, Last Year In Projection, First Age Class, Last Age Class, Number of Population Simulations, Number of Fleets, Number Of Recruitment Models, and Random Number Seed. If your model has discards, check the Discards are Present checkbox
- Click the "SET" Button
Loading an existing AGEPRO model from AGEPRO input file
- File > "Open a Existing AGEPRO Input Data File"
- Select *.inp file from file dialog to AGEPRO-GUI
ageproR
Make sure ageproR is loaded in your R workspace
Creating a new AGEPRO model
- Instantiate a new
agepro_model.
a. For agepro_model, set the parameters yr_start, yr_end, age_begin, age_end, num_pop_sims, num_fleets, num_rec_models. Optionally you can set seed and set discards_present if your model has discards.
require(ageproR)
test <- ageproR::agepro_model$new(2004, 2009, 1, 26, 100, 2, 1)
- Set the Recruit model
Loading an existing AGEPRO model from AGEPRO input file
- Instantiate a new
agepro_inp_model.
a. The parameters for agepro_inp_model have default values. You have the option to set these values. However the loading input data file will overwrite these.
require(ageproR)
testINP <- ageproR::agepro_inp_model_$new()
- Use your instance to call its class function
read_inp to read AGEPRO Input Files
- ageproR will verify that the Bootstrap File exists. If will also verify relative bootstrap filepath is in the same location with the input file being read. If not found, it will send a warning message.
Ways to resolve the issue
Todo
Create a AGEPRO Model
Loading an existing AGEPRO model from AGEPRO input file (or JSON)
Create a Helper function that allows the user to open/request a file, create a minimum agepro model and then populate it with the that input file.
Issue
There are a couple of issues that ageproR that will need to handle with "Loading AGEPRO input file to program" workload
a. AGEPRO-GUI is straightforward with menu + file-dialog.
b. ageproR requires a new instance of
agepro_inp_model, before loading a AGEPRO input fileR6Classnomenclature (agepro_model$initialize()) to create or create to load Agepro Models classes may be a usability road block.agepro_inp_modelwith user-specified values for keyword parameters will be overwritten by the imported AGEPRO input file.a. If the intention to use
agepro_inp_modelload from and save to AGEPRO Input Files, Shouldagepro_inp_modelbe used for creating new AGEPRO model cases since it will be needed to be saved to file?Detail
Creating new agepro models in agerproR is similar to AGEPRO-GUI's workflow. But loading AGEPRO input files to ageproR is different to AGEPRO GUI.
AGEPRO-GUI
Creating a new AGEPRO model
Loading an existing AGEPRO model from AGEPRO input file
ageproR
Make sure ageproR is loaded in your R workspace
Creating a new AGEPRO model
agepro_model.a. For
agepro_model, set the parametersyr_start,yr_end,age_begin,age_end,num_pop_sims,num_fleets,num_rec_models. Optionally you can setseedand setdiscards_presentif your model has discards.Loading an existing AGEPRO model from AGEPRO input file
agepro_inp_model.a. The parameters for
agepro_inp_modelhave default values. You have the option to set these values. However the loading input data file will overwrite these.read_inpto read AGEPRO Input FilesWays to resolve the issue
Todo
Create a AGEPRO Model
Loading an existing AGEPRO model from AGEPRO input file (or JSON)
Create a Helper function that allows the user to open/request a file, create a minimum agepro model and then populate it with the that input file.