Version 42 (modified by joeb, 14 years ago) (diff)


MSE Batch plugin user notes

10 Sept, 2010


The MSE Batch plugin runs the MSE (Management Strategy Evaluator) in batch mode from a command file. The command file runs the MSE changing input harvest rule parameters for each iteration and outputting data file.

MSE parameters available through the command file.

  1. Number of MSE simulations
  2. End Year
  3. Assessment and Implementation error
  4. Primary Production forcing functions
  5. Primary Production forcing function variation
  6. Fleet Control types
    • 0 No controls imposed on fleet
    • 1 Weakset stock
    • 2 Highest value stock
    • 3 Selective fishery
  7. Harvest rules
    • Fishing Mortality
    • Total Allowable Catch
    • Target Fishing Mortality (hockey stick parameters)

How to run

still to do Load the MSE batch plugin interface from the MSE in the navigation tree Load a command file hit the run button

MSE Batch iterations

The MSE Batch loops over Forcing Functions, Fleet Controls and Harvest Rules running the MSE for each set of parameters from the command file. Parameters not set by the command file will be left at the values loaded by the current Ecosim model.

Sample looping structure:

  For each Forcing Function 
    For each Fleet Control
      For each Harvest Rule 

        MSE run...

      next Harvest Rule
    next Fleet Control
  next Forcing Function

Command file format

The command file is a CSV (coma separated values) file that contains tags. A tag is a predefined string of text that appears at the start of the line and is used to identify the line as valid input for the MSE module. After the data part of the tag there must be a least one empty entry to mark the end of the valid data. All data that appears after the empty entry will be ignored. For example

Control_File_Version,1.0,,,ignored comments,,,

Lines in the command file that do not contain a recognized tag will be ignored. This allows a command file to contain comments, notes or other non parameter information as long the line does not start with a valid tag. The order of the tags in the file is not important and the command file can contain as many lines as the user wants.



  • Version number of the control file 1.0 for the current version. Used to identify parameters that may be in the file.


Model_Name,Some model.ewemdb,,,
  • File name of the EwE model
  • Used to check the command file against the currently loaded EwE model. If the models do not match a warning is issued.


  • Name of the Ecosim Scenario that the command file can work with. If the scenario name does not match a warning is issued. However, the command file can still be run.


  • Type of harvest rules to set for the current MSE Batch run. For each run of the MSE the harvest rules for the other Run_Type's will be set to zero.
  • Valid inputs,
    • 1 Fishing Mortality (Constant_F) sets the fishing mortality rates to a constant value for the run,
    • 2 Total Allowable Catch (Constant_Y) sets the catch to a constant value for the run,
    • 3 Target Fishing Mortality(Hockey stick) sets the fishing mortality using the Target Fishing Mortality rules,
    • 0 Any when this Run_Type option is set the harvest rules for other Run_Types will not be set to zero. Harvest rule values for groups not explicitly set by the command file will use the values in the currently load EwE model. This option allows for different types of harvest rules during the same MSE run.


  • Number of Ecosim simulation the MSE will run for each iteration. This is the 'Number of trials' parameter on the MSE run form.


  • Coefficient of variation for the observation and implementation error for the MSE stock assessment model. This is the equivalent of the Group CV's in the MSE interface.


Output_Directory,C:\EwE data,,
  • Directory where the MSE batch output will be sent. The MSE batch will try to create the directory if it does not already exist.


  • Last year (time step) the harvest rules are applied to the simulation run.
  • Valid values
    • -1 Harvest rules will be applied for the complete simulation run.
    • > 0 Harvest rules will be stopped before the end of the run. For all years greater than End_Year the simulation will use the current Ecosim Fishing Effort.


  • One standard deviation for normal distribution of Primary Production variance.


  • Primary Production forcing function from the currently loaded Ecosim model to load for an MSE Batch iteration.
  • Each line in the command file loads a separate forcing function then loops over all the Fleet Controls and Harvest Rules applying the parameters from the file.
  • Valid inputs
    • Forcing function index for the currently load Ecosim model. See EwE Scientific interface "Time dynamics (Ecoism)>Forcing function" for the currently loaded forcing functions and indexes.
    • Name of the forcing function. This is used to check the forcing function name in the file against the name in the EwE model. If they do not match then a warning will be posted but the run can still continue.
    • Ecosim group index to apply the forcing function to. Ecosim needs to know which primary production group to apply the forcing function to. If the Group index does not match a primary producer group in Ecosim the MSE Batch will post an error and will not run.

Control_Type_INDEX, Control_Type

  • Fleet controls