Class ParametricAnalysisRunner
java.lang.Object
common.controller.ParametricAnalysisRunner
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceNotified as the run progresses. -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidabortMeasure(int index) Aborts a measure across every running step.booleanvoidpause()Pauses every step currently running.voidrestart()Restarts every paused step.run()Runs every step of the parametric analysis and blocks until all of them have finished.voidstopRun()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.
-
Constructor Details
-
ParametricAnalysisRunner
public ParametricAnalysisRunner(SimulationDefinition simd, ParametricAnalysisRunner.Listener listener) - Parameters:
simd- the simulation definition carrying the parametric analysis modellistener- progress callback, or null for a silent run
-
-
Method Details
-
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:
abortMeasurein interfaceAbortMeasure- Parameters:
index- index of the measure to be aborted
-