Class DiagnosticToolController
java.lang.Object
org.moeaframework.util.mvc.Controller
org.moeaframework.analysis.diagnostics.DiagnosticToolController
- All Implemented Interfaces:
EventListener
,SettingChangedListener
The controller manages the underlying data model, performs the evaluation of jobs, and notifies any listeners when
its state changes.
-
Constructor Summary
ConstructorDescriptionConstructs a new controller for the specifiedDiagnosticTool
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(String algorithm, String problem, ResultSeries series) Adds a new result to this controller.void
add
(ResultKey key, ResultSeries series) Adds a new result to this controller.void
cancel()
Notifies the controller that it should cancel the current evaluation job.void
clear()
Clears all results from this collector.void
Clears the last result series.Returns an unmodifiable collection containing the results associated with the specified key.getKeys()
Returns an unmodifiable set of result keys contained in this controller.Returns the last result series to be generated; ornull
if there is none or has been cleared.int
Returns the overall progress of the current job being evaluated.int
Returns the run progress of the current job being evaluated.Returns the setting for collecting adaptive multimethod variation probabilities.Returns the setting for collecting adaptive time continuation metrics.Returns the setting for collecting the additive epsilon indicator.Returns the setting for collecting the contribution indicator.Returns the setting for collecting the elapsed runtime.Returns the setting for collecting epsilon progress metrics.Returns the setting for collecting the generational distance (GD) indicator.Returns the setting for collecting the generational distance plus (GD+) indicator.Returns the setting for collecting the hypervolume indicator.Returns the setting for collecting the inverted generational distance (IGD) indicator.Returns the setting for collecting the inverted generational distance plus (IGD+) indicator.Returns the setting for collecting the population / archive size.Returns the setting for collecting the R1 indicator.Returns the setting for collecting the R2 indicator.Returns the setting for collecting the R3 indicator.Returns the setting for collecting the spacing indicator.boolean
Returnstrue
if this controller is currently processing an evaluation job;false
otherwise.void
join()
Waits for the currently running thread to finish.void
Loads all results stored in the specified file.void
run()
Launches a thread to run the current evaluation job.void
Saves all results stored in this controller to the specified file.void
Called when the value of a setting changed.Returns the setting for displaying individual traces versus quantiles.Returns the setting for displaying the last trace.Creates and displays a dialog containing a statistical comparison of the selected results.protected void
updateProgress
(int currentEvaluation, int currentSeed, int totalEvaluations, int totalSeeds) Updates the progress of this controller.Methods inherited from class org.moeaframework.util.mvc.Controller
addControllerListener, addShutdownHook, displayError, fireEvent, handleException, loadPreferences, removeControllerListener, savePreferences, shutdown, startup
-
Constructor Details
-
DiagnosticToolController
Constructs a new controller for the specifiedDiagnosticTool
instance.- Parameters:
frame
- theDiagnosticTool
instance using this controller
-
-
Method Details
-
add
Adds a new result to this controller. If the specified key already exists, the result series is appended to the existing results.- Parameters:
key
- the result key identifying the algorithm and problem associated with these resultsseries
- the result series storing the collected data
-
add
Adds a new result to this controller. This method invokesadd(ResultKey, ResultSeries)
.- Parameters:
algorithm
- the algorithm associated with these resultsproblem
- the problem associated with these resultsseries
- the result series storing the collected data
-
clear
public void clear()Clears all results from this collector. -
get
Returns an unmodifiable collection containing the results associated with the specified key.- Parameters:
key
- the result key- Returns:
- an unmodifiable collection containing the results associated with the specified key
-
getKeys
Returns an unmodifiable set of result keys contained in this controller.- Returns:
- an unmodifiable set of result keys contained in this controller
-
getLastSeries
Returns the last result series to be generated; ornull
if there is none or has been cleared.- Returns:
- the last result series to be generated; or
null
-
clearLastSeries
public void clearLastSeries()Clears the last result series. Subsequent invocations ofgetLastSeries()
will returnnull
until a new result series is generated. -
saveData
Saves all results stored in this controller to the specified file.- Parameters:
file
- the file to which the results are saved- Throws:
IOException
- if an I/O error occurred
-
loadData
Loads all results stored in the specified file.- Parameters:
file
- the file containing the results to load- Throws:
IOException
- if an I/O error occurred
-
updateProgress
protected void updateProgress(int currentEvaluation, int currentSeed, int totalEvaluations, int totalSeeds) Updates the progress of this controller.- Parameters:
currentEvaluation
- the current evaluation numbercurrentSeed
- the current seed numbertotalEvaluations
- the total number of evaluationstotalSeeds
- the total number of seeds
-
showStatistics
Creates and displays a dialog containing a statistical comparison of the selected results.- Returns:
- the dialog, or
null
if unable to display
-
run
public void run()Launches a thread to run the current evaluation job. -
cancel
public void cancel()Notifies the controller that it should cancel the current evaluation job. -
isRunning
public boolean isRunning()Returnstrue
if this controller is currently processing an evaluation job;false
otherwise.- Returns:
true
if this controller is currently processing an evaluation job;false
otherwise
-
join
Waits for the currently running thread to finish. If there is no such thread, this method returns immediately.- Throws:
InterruptedException
- if the thread was interrupted
-
showLastTrace
Returns the setting for displaying the last trace.- Returns:
- the setting object
-
includeHypervolume
Returns the setting for collecting the hypervolume indicator.- Returns:
- the setting object
-
includeGenerationalDistance
Returns the setting for collecting the generational distance (GD) indicator.- Returns:
- the setting object
-
includeGenerationalDistancePlus
Returns the setting for collecting the generational distance plus (GD+) indicator.- Returns:
- the setting object
-
includeInvertedGenerationalDistance
Returns the setting for collecting the inverted generational distance (IGD) indicator.- Returns:
- the setting object
-
includeInvertedGenerationalDistancePlus
Returns the setting for collecting the inverted generational distance plus (IGD+) indicator.- Returns:
- the setting object
-
includeSpacing
Returns the setting for collecting the spacing indicator.- Returns:
- the setting object
-
includeAdditiveEpsilonIndicator
Returns the setting for collecting the additive epsilon indicator.- Returns:
- the setting object
-
includeContribution
Returns the setting for collecting the contribution indicator.- Returns:
- the setting object
-
includeR1
Returns the setting for collecting the R1 indicator.- Returns:
- the setting object
-
includeR2
Returns the setting for collecting the R2 indicator.- Returns:
- the setting object
-
includeR3
Returns the setting for collecting the R3 indicator.- Returns:
- the setting object
-
includeEpsilonProgress
Returns the setting for collecting epsilon progress metrics.- Returns:
- the setting object
-
includeAdaptiveMultimethodVariation
Returns the setting for collecting adaptive multimethod variation probabilities.- Returns:
- the setting object
-
includeAdaptiveTimeContinuation
Returns the setting for collecting adaptive time continuation metrics.- Returns:
- the setting object
-
includeElapsedTime
Returns the setting for collecting the elapsed runtime.- Returns:
- the setting object
-
includePopulationSize
Returns the setting for collecting the population / archive size.- Returns:
- the setting object
-
showIndividualTraces
Returns the setting for displaying individual traces versus quantiles.- Returns:
- the setting object
-
getRunProgress
public int getRunProgress()Returns the run progress of the current job being evaluated. The run progress measures the number of evaluations completed thus far.- Returns:
- the run progress of the current job being evaluated
-
getOverallProgress
public int getOverallProgress()Returns the overall progress of the current job being evaluated. The overall progress measures the number of seeds completed thus far.- Returns:
- the overall progress of the current job being evaluated
-
settingChanged
Description copied from interface:SettingChangedListener
Called when the value of a setting changed.- Specified by:
settingChanged
in interfaceSettingChangedListener
- Parameters:
event
- details of the change
-