Multirun Output

Last updated on 26th March 2024

Running a model as a multirun will return results in a RunResult object. Note, this is only available for batch runs. For model sampler and scenario runs, this object will be empty.

RunResult objects store the aggregated results for each step as an Apache Commons DescriptiveStatistics object. This can be used to extract the aggregated result for individual outputs/variables, as a VariableResult object.

RunResult can return the full list of outputs/variables that have been reported, with RunResult#listEntries.

/** Model output
 * {
 *  "output1": ...,
 *  "accumulatorOutput": 
 *    {
 *      "value": ...,
 *      "count" ...,
 *      "mean" ...    
 *    }
 * }
 */
     
 VariableResult outputResult = runResult.get("output1")
 VariableResult accumulatorResult = runResult.get("accumulatorOutput.value")

The VariableResult can then be used to get the specific DescriptiveStatistics for any step, or merge them together and give a single statistics object for the whole run, across all steps.

DescriptiveStatistics outputStatsStep1 = outputResult.getStatsAtStep(1);
DescriptiveStatistics outputStats = outputResult.getAggregatedStats();

More information on using the Apache Commons DescriptiveStatistics returned can be found on their documentation page

http://commons.apache.org/proper/commons-math/javadocs/api-3.3/org/apache/commons/math3/stat/descriptive/DescriptiveStatistics.html