Class DiagnosticToolController

java.lang.Object
org.moeaframework.util.mvc.Controller
org.moeaframework.analysis.diagnostics.DiagnosticToolController
All Implemented Interfaces:
EventListener, SettingChangedListener

public class DiagnosticToolController extends Controller implements SettingChangedListener
The controller manages the underlying data model, performs the evaluation of jobs, and notifies any listeners when its state changes.
  • Constructor Details

    • DiagnosticToolController

      public DiagnosticToolController(DiagnosticTool frame)
      Constructs a new controller for the specified DiagnosticTool instance.
      Parameters:
      frame - the DiagnosticTool instance using this controller
  • Method Details

    • add

      public void add(ResultKey key, ResultSeries series)
      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 results
      series - the result series storing the collected data
    • add

      public void add(String algorithm, String problem, ResultSeries series)
      Adds a new result to this controller. This method invokes add(ResultKey, ResultSeries).
      Parameters:
      algorithm - the algorithm associated with these results
      problem - the problem associated with these results
      series - the result series storing the collected data
    • clear

      public void clear()
      Clears all results from this collector.
    • get

      public List<ResultSeries> get(ResultKey key)
      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

      public Set<ResultKey> getKeys()
      Returns an unmodifiable set of result keys contained in this controller.
      Returns:
      an unmodifiable set of result keys contained in this controller
    • getLastSeries

      public ResultSeries getLastSeries()
      Returns the last result series to be generated; or null 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 of getLastSeries() will return null until a new result series is generated.
    • saveData

      public void saveData(File file) throws IOException
      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

      public void loadData(File file) throws IOException
      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 number
      currentSeed - the current seed number
      totalEvaluations - the total number of evaluations
      totalSeeds - the total number of seeds
    • showStatistics

      public TextViewer 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()
      Returns true 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

      public void join() throws InterruptedException
      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

      public Toggle showLastTrace()
      Returns the setting for displaying the last trace.
      Returns:
      the setting object
    • includeHypervolume

      public Toggle includeHypervolume()
      Returns the setting for collecting the hypervolume indicator.
      Returns:
      the setting object
    • includeGenerationalDistance

      public Toggle includeGenerationalDistance()
      Returns the setting for collecting the generational distance (GD) indicator.
      Returns:
      the setting object
    • includeGenerationalDistancePlus

      public Toggle includeGenerationalDistancePlus()
      Returns the setting for collecting the generational distance plus (GD+) indicator.
      Returns:
      the setting object
    • includeInvertedGenerationalDistance

      public Toggle includeInvertedGenerationalDistance()
      Returns the setting for collecting the inverted generational distance (IGD) indicator.
      Returns:
      the setting object
    • includeInvertedGenerationalDistancePlus

      public Toggle includeInvertedGenerationalDistancePlus()
      Returns the setting for collecting the inverted generational distance plus (IGD+) indicator.
      Returns:
      the setting object
    • includeSpacing

      public Toggle includeSpacing()
      Returns the setting for collecting the spacing indicator.
      Returns:
      the setting object
    • includeAdditiveEpsilonIndicator

      public Toggle includeAdditiveEpsilonIndicator()
      Returns the setting for collecting the additive epsilon indicator.
      Returns:
      the setting object
    • includeContribution

      public Toggle includeContribution()
      Returns the setting for collecting the contribution indicator.
      Returns:
      the setting object
    • includeR1

      public Toggle includeR1()
      Returns the setting for collecting the R1 indicator.
      Returns:
      the setting object
    • includeR2

      public Toggle includeR2()
      Returns the setting for collecting the R2 indicator.
      Returns:
      the setting object
    • includeR3

      public Toggle includeR3()
      Returns the setting for collecting the R3 indicator.
      Returns:
      the setting object
    • includeEpsilonProgress

      public Toggle includeEpsilonProgress()
      Returns the setting for collecting epsilon progress metrics.
      Returns:
      the setting object
    • includeAdaptiveMultimethodVariation

      public Toggle includeAdaptiveMultimethodVariation()
      Returns the setting for collecting adaptive multimethod variation probabilities.
      Returns:
      the setting object
    • includeAdaptiveTimeContinuation

      public Toggle includeAdaptiveTimeContinuation()
      Returns the setting for collecting adaptive time continuation metrics.
      Returns:
      the setting object
    • includeElapsedTime

      public Toggle includeElapsedTime()
      Returns the setting for collecting the elapsed runtime.
      Returns:
      the setting object
    • includePopulationSize

      public Toggle includePopulationSize()
      Returns the setting for collecting the population / archive size.
      Returns:
      the setting object
    • showIndividualTraces

      public Toggle 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

      public void settingChanged(SettingChangedEvent event)
      Description copied from interface: SettingChangedListener
      Called when the value of a setting changed.
      Specified by:
      settingChanged in interface SettingChangedListener
      Parameters:
      event - details of the change