Class ParametricAnalysisRunner

java.lang.Object
common.controller.ParametricAnalysisRunner
All Implemented Interfaces:
AbortMeasure

public class ParametricAnalysisRunner extends Object implements AbortMeasure

Title: ParametricAnalysisRunner

Description: Runs every step of a What-If (parametric analysis) simulation and aggregates the per-step results into a single PAResultsModel.

This class contains no Swing code and shows nothing on screen, so a What-If analysis can be driven from a headless context - the command line, a test harness, or a CI job. PADispatcherThread wraps it to supply the progress window and the results window; everything those two share lives here, so a fix to the step loop reaches both callers.

See Also:
  • Constructor Details

    • ParametricAnalysisRunner

      public ParametricAnalysisRunner(SimulationDefinition simd, ParametricAnalysisRunner.Listener listener)
      Parameters:
      simd - the simulation definition carrying the parametric analysis model
      listener - progress callback, or null for a silent run
  • Method Details

    • run

      public PAResultsModel run()
      Runs every step of the parametric analysis and blocks until all of them have finished. The model's original values are restored before returning.
      Returns:
      the aggregated results, or null if no step produced any measure
    • isStopped

      public boolean isStopped()
      Returns:
      true if the run was ended early by stopRun()
    • pause

      public void pause()
      Pauses every step currently running.
    • stopRun

      public void stopRun()
      Stops the run, aborting the measures of every step still in flight, and blocks until the results of the steps that did finish have been collected.
    • restart

      public void restart()
      Restarts every paused step.
    • abortMeasure

      public void abortMeasure(int index)
      Aborts a measure across every running step.
      Specified by:
      abortMeasure in interface AbortMeasure
      Parameters:
      index - index of the measure to be aborted