Skip to content

Loading existing AGEPRO input files to ageproR user experience (compared to AGEPRO-GUI) #101

@efletcherPIFSC

Description

@efletcherPIFSC

Issue

There are a couple of issues that ageproR that will need to handle with "Loading AGEPRO input file to program" workload

  1. 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
  2. Using R6Class nomenclature (agepro_model$initialize()) to create or create to load Agepro Models classes may be a usability road block.
  3. 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

  1. 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
  2. Click the "SET" Button

Loading an existing AGEPRO model from AGEPRO input file

  1. File > "Open a Existing AGEPRO Input Data File"
  2. Select *.inp file from file dialog to AGEPRO-GUI

ageproR

Make sure ageproR is loaded in your R workspace

Creating a new AGEPRO model

  1. 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)
  1. Set the Recruit model

Loading an existing AGEPRO model from AGEPRO input file

  1. 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()
  1. Use your instance to call its class function read_inp to read AGEPRO Input Files
testINP$read_inp()
  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions