9 Print Files

The print files are used to control the output from the Gadget model (and not the output from the optimisation process). To avoid writing the model output from each iteration of a optimising process (and thus generating very large files), any printfile settings are ignored if Gadget is started with the -l switch.

To define print files in the Gadget model, the “main” file must contain a list of the data files that contain the description of the printer classes required, and the format for this is shown below:

printfiles           <names of the print files>

The print files contain a list of various type of printer classes, separated by the keyword [component], that output different information from the model, and the name of the file that the information is to be written to. All the output is written as a plain ASCII text file that can be viewed in any text editor. The format of the print file is follows:

[component]
type                 <printer type>
<printer data>

The printer data for each printer type is covered in the sub sections below. The \(<\)printer type\(>\) defines the type of output that will be generated from the Gadget model, and there are currently 11 valid printer types defined in Gadget. These are:

StockStdPrinter StockFullPrinter StockPrinter PredatorPrinter PredatorOverPrinter PreyOverPrinter StockPreyFullPrinter StockPreyPrinter PredatorPreyPrinter LikelihoodPrinter LikelihoodSummaryPrinter

9.1 StockStdPrinter

The printer type to output the standard details of a stock is called “StockStdPrinter”. This printer type is defined by specifying the stock and timesteps of interest. The file format for this component is given below:

[component]
type                 stockstdprinter
stockname            <name of the stock>
scale                <scaling factor>
printfile            <name for the output file to be created>
precision            <precision to be used in the output file>
printatstart         <0 or 1> ; 1 to print at start of timestep
yearsandsteps        <ActionAtTime to determine when to print>

The optional \(<\)scale\(>\) factor is used to scale the size of the stock, which can be used to display the stock in terms of thousands of fish, for example. The default value for this parameter is 1, which will ensure that no scaling will take place.

The optional \(<\)precision\(>\) value is used to specify the number of digits to be used when printing the information to the specified output file, overriding the default settings for this printer type.

The optional flag \(<\)printatstart\(>\) is used to specify whether the information about the stock should be printed at the start or the end of the timestep. If this is set to 1, then the stock information as it is at the start of the timestep is printed, before any other calculation has taken place (see appendix 15 for more information on the order of the calculations). The default value for \(<\)printatstart\(>\) is 0, which means that the information at the end of the timestep is printed, and is used whenever the flag is not specified in the input file.

The output that is generated from this printer type is a file containing the following information for the stock specified on the \(<\)stockname\(>\) line:

year-step-area-age-number-length-weight-stddev-consumed-biomass

where: \(<\)number\(>\) is the stock population for that timestep/area/age combination \(<\)length\(>\) is the mean length for that timestep/area/age combination \(<\)weight\(>\) is the mean weight for that timestep/area/age combination \(<\)stddev\(>\) is the standard deviation for the length for that timestep/area/age combination \(<\)consumed\(>\) is the stock population that has been consumed by all the predators (including fleets) for that timestep/area/age combination \(<\)biomass\(>\) is the stock biomass that has been consumed by all the predators (including fleets) for that timestep/area/age combination

9.2 StockFullPrinter

The printer type to output some more detailed information about a stock is called “StockFullPrinter”. This printer type is defined by specifying the stock and timesteps of interest. The file format for this component is given below:

[component]
type                 stockfullprinter
stockname            <name of the stock>
printfile            <name for the output file to be created>
precision            <precision to be used in the output file>
printatstart         <0 or 1> ; 1 to print at start of timestep
yearsandsteps        <ActionAtTime to determine when to print>

The optional \(<\)precision\(>\) value is used to specify the number of digits to be used when printing the information to the specified output file, overriding the default settings for this printer type.

The optional flag \(<\)printatstart\(>\) is used to specify whether the information about the stock should be printed at the start or the end of the timestep. If this is set to 1, then the stock information as it is at the start of the timestep is printed, before any other calculation has taken place (see appendix 15 for more information on the order of the calculations). The default value for \(<\)printatstart\(>\) is 0, which means that the information at the end of the timestep is printed, and is used whenever the flag is not specified in the input file.

The output that is generated from this printer type is a file containing the following information for the stock specified on the \(<\)stockname\(>\) line:

year-step-area-age-length-number-weight

where: \(<\)number\(>\) is the population for that timestep/area/age/length combination \(<\)weight\(>\) is the mean weight for that timestep/area/age/length combination

9.3 StockPrinter

The printer type to output information about (one or more) stocks, with the information aggregated into a convenient grouping, is called “StockPrinter”. This printer type is defined by specifying the stocks, areas, age groups, length groups and timesteps of interest. The file format for this component is given below:

[component]
type                 stockprinter
stocknames           <vector of the names of the stocks>
areaaggfile          <area aggregation file specifying areas>
ageaggfile           <age aggregation file specifying ages>
lenaggfile           <length aggregation file specifying lengths>
printfile            <name for the output file to be created>
precision            <precision to be used in the output file>
printatstart         <0 or 1> ; 1 to print at start of timestep
yearsandsteps        <ActionAtTime to determine when to print>

Note that this printer type can aggregate more than one stock into a combined pseudo stock for the output file.

The optional \(<\)precision\(>\) value is used to specify the number of digits to be used when printing the information to the specified output file, overriding the default settings for this printer type.

The optional flag \(<\)printatstart\(>\) is used to specify whether the information about the stock should be printed at the start or the end of the timestep. If this is set to 1, then the stock information as it is at the start of the timestep is printed, before any other calculation has taken place (see appendix 15 for more information on the order of the calculations). The default value for \(<\)printatstart\(>\) is 0, which means that the information at the end of the timestep is printed, and is used whenever the flag is not specified in the input file.

The output that is generated from this printer type is a file containing the following information for all the stocks specified on the \(<\)stocknames\(>\) line:

year-step-area-age-length-number-weight

where: \(<\)area\(>\) is the label for the area from the area aggregation file \(<\)age\(>\) is the label for the age group from the age aggregation file \(<\)length\(>\) is the label for the length group from the length aggregation file \(<\)number\(>\) is the population for that timestep/area/age/length combination \(<\)weight\(>\) is the mean weight for that timestep/area/age/length combination

9.4 PredatorPrinter

The printer type to output information about predation, with the information aggregated into a convenient grouping, is called “PredatorPrinter”. This printer type is defined by specifying the predators, preys, areas, length groups and timesteps of interest. The file format for this component is given below:

[component]
type                 predatorprinter
predatornames        <vector of the names of the predators>
preynames            <vector of the names of the preys>
areaaggfile          <area aggregation file specifying areas>
predlenaggfile       <length aggregation file specifying predator lengths>
preylenaggfile       <length aggregation file specifying prey lengths>
biomass              <0 or 1> ; 1 to print biomass consumed
printfile            <name for the output file to be created>
precision            <precision to be used in the output file>
yearsandsteps        <ActionAtTime to determine when to print>

Note that this printer type can aggregate more than one predator into a combined pseudo predator, and more than one prey into a pseudo prey, for the output file.

The optional flag \(<\)biomass\(>\) is used to specify whether the information about the consumption of the preys by the predators is printed by biomass consumed or by number consumed. If this is set to 1 then information about the consumption is printed by biomass consumed. If this is set to 0 then this information is printed by number consumed. The default value for \(<\)biomass\(>\) is 1, which means that the consumption by biomass will be printed if this flag is not specified in the input file.

The optional \(<\)precision\(>\) value is used to specify the number of digits to be used when printing the information to the specified output file, overriding the default settings for this printer type.

The output that is generated from this printer type is a file containing the following predation information for all the predators specified on the \(<\)predatornames\(>\) line, consuming all the preys specified on the \(<\)preynames\(>\) line:

year-step-area-pred-prey-amount

where: \(<\)area\(>\) is the label for the area from the area aggregation file \(<\)pred\(>\) is the label for the predator length group from the length aggregation file \(<\)prey\(>\) is the label for the prey length group from the length aggregation file \(<\)amount\(>\) is the biomass (or number) consumed for that timestep/area/predator length/prey length combination, depending on the value of the \(<\)biomass\(>\) flag in the input file

9.5 PredatorOverPrinter

The printer type to output information about predator over consumption (where a predator has failed to eat the required amount of prey since the prey is not available), with the information aggregated into a convenient grouping, is called “PredatorOverPrinter”. This printer type is defined by specifying the predators, areas, length groups and timesteps of interest. The file format for this component is given below:

[component]
type                 predatoroverprinter
predatornames        <vector of the names of the predators>
areaaggfile          <area aggregation file specifying areas>
lenaggfile           <length aggregation file specifying lengths>
printfile            <name for the output file to be created>
precision            <precision to be used in the output file>
yearsandsteps        <ActionAtTime to determine when to print>

Note that this printer type can aggregate more than one predator into a combined pseudo predator for the output file.

The optional \(<\)precision\(>\) value is used to specify the number of digits to be used when printing the information to the specified output file, overriding the default settings for this printer type.

The output that is generated from this printer type is a file containing the following over-consumption information for all the predators specified on the \(<\)predatornames\(>\) line:

year-step-area-length-biomass

where: \(<\)area\(>\) is the label for the area from the area aggregation file \(<\)length\(>\) is the label for the length group from the length aggregation file \(<\)biomass\(>\) is the biomass that the predator failed to consume for that timestep/area/length combination

9.6 PreyOverPrinter

The printer type to output information about prey over consumption (where there has been insufficient prey for a predator to consume), with the information aggregated into a convenient grouping, is called “PreyOverPrinter”. This printer type is the inverse of the PredatorOverPrinter printer type, in that it gives the same information, but from the point of view of the preys, not the predators. This printer type is defined by specifying the preys, areas, length groups and timesteps of interest. The file format for this component is given below:

[component]
type                 preyoverprinter
preynames            <vector of the names of the preys>
areaaggfile          <area aggregation file specifying areas>
lenaggfile           <length aggregation file specifying lengths>
printfile            <name for the output file to be created>
precision            <precision to be used in the output file>
yearsandsteps        <ActionAtTime to determine when to print>

Note that this printer type can aggregate more than one prey into a combined pseudo prey for the output file.

The optional \(<\)precision\(>\) value is used to specify the number of digits to be used when printing the information to the specified output file, overriding the default settings for this printer type.

The output that is generated from this printer type is a file containing the following over-consumption information for all the preys specified on the \(<\)preynames\(>\) line:

year-step-area-length-biomass

where: \(<\)area\(>\) is the label for the area from the area aggregation file \(<\)length\(>\) is the label for the length group from the length aggregation file \(<\)biomass\(>\) is the biomass of the prey that was unavailable, for that timestep/area/length combination

9.7 StockPreyFullPrinter

The printer type to output detailed information about a prey is called “StockPreyFullPrinter”. This printer type is defined by specifying the prey and timesteps of interest. The file format for this component is given below:

[component]
type                 stockpreyfullprinter
preyname             <name of the prey>
printfile            <name for the output file to be created>
precision            <precision to be used in the output file>
yearsandsteps        <ActionAtTime to determine when to print>

The optional \(<\)precision\(>\) value is used to specify the number of digits to be used when printing the information to the specified output file, overriding the default settings for this printer type.

The output that is generated from this printer type is a file containing the following information for the prey specified on the \(<\)preyname\(>\) line:

year-step-area-age-length-number-biomass

where: \(<\)number\(>\) is the total population consumed for that timestep/area/age/length combination \(<\)biomass\(>\) is the total biomass consumed for that timestep/area/age/length combination

9.8 StockPreyPrinter

The printer type to output information about (one or more) preys, with the information aggregated into a convenient grouping, is called “StockPreyPrinter”. This printer type is defined by specifying the preys, areas, age groups, length groups and timesteps of interest. The file format for this component is given below:

[component]
type                 stockpreyprinter
preynames            <vector of the names of the preys>
printfile            <name for the output file to be created>
areaaggfile          <area aggregation file specifying areas>
ageaggfile           <age aggregation file specifying ages>
lenaggfile           <length aggregation file specifying lengths>
precision            <precision to be used in the output file>
yearsandsteps        <ActionAtTime to determine when to print>

Note that this printer type can aggregate more than one prey into a combined pseudo prey for the output file.

The optional \(<\)precision\(>\) value is used to specify the number of digits to be used when printing the information to the specified output file, overriding the default settings for this printer type.

The output that is generated from this printer type is a file containing the following information for all the preys specified on the \(<\)preynames\(>\) line:

year-step-area-age-length-number-biomass

where: \(<\)area\(>\) is the label for the area from the area aggregation file \(<\)age\(>\) is the label for the age group from the age aggregation file \(<\)length\(>\) is the label for the length group from the length aggregation file \(<\)number\(>\) is the total population consumed for that timestep/area/age/length combination \(<\)biomass\(>\) is the total biomass consumed for that timestep/area/age/length combination

9.9 PredatorPreyPrinter

The printer type to output detailed information about predator-prey combinations, with the information aggregated into a convenient grouping, is called “PredatorPreyPrinter”. This printer type is defined by specifying the predators, preys, areas, age groups, length groups and timesteps of interest. The file format for this component is given below:

[component]
type                 predatorpreyprinter
predatornames        <vector of the names of the predators>
preynames            <vector of the names of the preys>
areaaggfile          <area aggregation file specifying areas>
ageaggfile           <age aggregation file specifying prey ages>
lenaggfile           <length aggregation file specifying prey lengths>
printfile            <name for the output file to be created>
precision            <precision to be used in the output file>
yearsandsteps        <ActionAtTime to determine when to print>

Note that this printer type can aggregate more than one predator into a combined pseudo predator, and more than one prey into a pseudo prey, for the output file.

The optional \(<\)precision\(>\) value is used to specify the number of digits to be used when printing the information to the specified output file, overriding the default settings for this printer type.

The output that is generated from this printer type is a file containing the following predation information for all the predators specified on the \(<\)predatornames\(>\) line, consuming all the preys specified on the \(<\)preynames\(>\) line:

year-step-area-age-length-number-biomass-mortality

where: \(<\)age\(>\) is the label for the prey age group from the age aggregation file \(<\)length\(>\) is the label for the prey length group from the length aggregation file \(<\)number\(>\) is the number consumed for that timestep/area/age/length combination \(<\)biomass\(>\) is the biomass consumed for that timestep/area/age/length combination \(<\)mortality\(>\) is the effective annual mortality induced in the prey by the predation for that timestep/area/age/length combination

9.10 LikelihoodPrinter

The printer type to output detailed information about a likelihood component is called “LikelihoodPrinter”. This printer type is defined by specifying the likelihood component and timesteps of interest. The file format for this component is given below:

[component]
type                 likelihoodprinter
likelihood           <name of the likelihood component>
printfile            <name for the output file to be created>

The output that is generated from this printer type is a file containing the internal model information for the likelihood component specified on the \(<\)likelihood\(>\) line, in the same format as the data in the input file for that component, allowing the user to easily compare the modelled data to the input data. The exact format of this output file will vary according to the likelihood component chosen. Some examples of output are:

  1. CatchDistribution likelihood component (see section 8.3)

    year-step-area-age-length-number
  2. CatchStatistics likelihood component (see section 8.4)

    year-step-area-age-number-mean[-stddev]
  3. SurveyIndices likelihood component (see section @ref(#sec:surveyindices))

    year-step-area-index-number

9.11 LikelihoodSummaryPrinter

The printer type to output summary information about all the likelihood components that are in use for the current simulation is called “LikelihoodSummaryPrinter”. The file format for this component is given below:

[component]
type                 likelihoodsummaryprinter
printfile            <name for the output file to be created>

The output that is generated from this printer type is a file containing summary information for all the likelihood components that have been defined for the current simulation:

year-step-area-component-weight-score

where: \(<\)component\(>\) is the name of the likelihood component \(<\)weight\(>\) is the weight of the likelihood component \(<\)score\(>\) is the score from the likelihood component for that timestep/area combination