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
AGEPRO-GUI is tied with GUI data and "inputFile" Class Data via AGEPRO-CoreLib.
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
inputFile
A new instance of "inputFile" class is created when "Open File Dialog" is shown, if its a valid AGEPRO input file path then it will attempt to import the data to that inputFile class. After a successful, run, it will flag the GUI to allow the user to set that model parameters. In addition to this, the input filename path/format will be on the general params panel. Data on the GUI objects get saved to "inputFile" object class.
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.
Resolution
Helper functions create_agepro_model and import_agepro_model will ease users to create agepro_model classes without requiring the knowledge of R6Class Initialization.
- Created helper function
create_agepro_model to create a new instance of a agepro_inp_model or agepro_json_model R6class. Helper Function import_agepro_model returns a new agepro_inp_model R6class instance with data imported from an AGEPRO input file.
- Update documentation (and code examples) to use helper function
create_agepro_model and import_agepro_model
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
AGEPRO-GUI is tied with GUI data and "inputFile" Class Data via AGEPRO-CoreLib.
Creating a new AGEPRO model
Loading an existing AGEPRO model from AGEPRO input file
inputFile
A new instance of "inputFile" class is created when "Open File Dialog" is shown, if its a valid AGEPRO input file path then it will attempt to import the data to that inputFile class. After a successful, run, it will flag the GUI to allow the user to set that model parameters. In addition to this, the input filename path/format will be on the general params panel. Data on the GUI objects get saved to "inputFile" object class.
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 FilesResolution
Helper functions
create_agepro_modelandimport_agepro_modelwill ease users to create agepro_model classes without requiring the knowledge of R6Class Initialization.create_agepro_modelto create a new instance of aagepro_inp_modeloragepro_json_modelR6class. Helper Functionimport_agepro_modelreturns a newagepro_inp_modelR6class instance with data imported from an AGEPRO input file.create_agepro_modelandimport_agepro_model