Class Controller

java.lang.Object
org.moeaframework.analysis.diagnostics.Controller

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

    • Controller

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

    • addControllerListener

      public void addControllerListener(ControllerListener listener)
      Adds the specified listener to receive all subsequent controller events.
      Parameters:
      listener - the listener to receive controller events
    • removeControllerListener

      public void removeControllerListener(ControllerListener listener)
      Removes the specified listener so it no longer receives controller events.
      Parameters:
      listener - the listener to no longer receive controller events
    • fireModelChangedEvent

      protected void fireModelChangedEvent()
      Fires a MODEL_CHANGED controller event.
    • fireStateChangedEvent

      protected void fireStateChangedEvent()
      Fires a STATE_CHANGED controller event.
    • fireProgressChangedEvent

      protected void fireProgressChangedEvent()
      Fires a PROGRESS_CHANGED controller event.
    • fireViewChangedEvent

      protected void fireViewChangedEvent()
      Fires a VIEW_CHANGED controller event.
    • fireEvent

      protected void fireEvent(ControllerEvent event)
      Fires the specified controller event. All listeners will receive this event on the event dispatch thread.
      Parameters:
      event - the controller event to fire
    • add

      public void add(ResultKey key, Observations observation)
      Adds a new result to this controller. If the specified key already exists, the observation is appended to the existing results. A MODEL_CHANGED event is fired.
      Parameters:
      key - the result key identifying the algorithm and problem associated with these results
      observation - the observation storing the results
    • add

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

      public void clear()
      Clears all results from this collector. A MODEL_CHANGED event is fired.
    • get

      public List<Observations> 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
    • getLastObservation

      public Observations getLastObservation()
      Returns the last observation to be generated; or null if there is none or has been cleared
      Returns:
      the last observation to be generated; or null
    • clearLastObservation

      public void clearLastObservation()
      Clears the last observation. Subsequent invocations of getLastObservation() will return null until a new observation 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. A MODEL_CHANGED event is fired.
      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. A PROGRESS_CHANGED event is fired.
      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 void showStatistics()
      Creates and displays a dialog containing a statistical comparison of the selected results.
    • 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
    • getShowLastTrace

      public boolean getShowLastTrace()
      Returns true if the last run's trace is displayed; false otherwise.
      Returns:
      true if the last run's trace is displayed; false otherwise
    • setShowLastTrace

      public void setShowLastTrace(boolean showLastTrace)
      Sets the display of the last run's trace.
      Parameters:
      showLastTrace - true if the last run's trace is displayed; false otherwise
    • getIncludeHypervolume

      public boolean getIncludeHypervolume()
      Returns true if the hypervolume indicator collector is included; false otherwise.
      Returns:
      true if the hypervolume indicator collector is included; false otherwise
    • setIncludeHypervolume

      public void setIncludeHypervolume(boolean includeHypervolume)
      Sets the inclusion of the hypervolume indicator collector.
      Parameters:
      includeHypervolume - true if the hypervolume collector is included; false otherwise
    • getIncludeGenerationalDistance

      public boolean getIncludeGenerationalDistance()
      Returns true if the generational distance indicator collector is included; false otherwise.
      Returns:
      true if the generational distance indicator collector is included; false otherwise
    • setIncludeGenerationalDistance

      public void setIncludeGenerationalDistance(boolean includeGenerationalDistance)
      Sets the inclusion of the generational distance indicator collector.
      Parameters:
      includeGenerationalDistance - true if the generational distance indicator collector is included; false otherwise
    • getIncludeInvertedGenerationalDistance

      public boolean getIncludeInvertedGenerationalDistance()
      Returns true if the inverted generational distance indicator collector is included; false otherwise.
      Returns:
      true if the inverted generational distance indicator collector is included; false otherwise
    • setIncludeInvertedGenerationalDistance

      public void setIncludeInvertedGenerationalDistance(boolean includeInvertedGenerationalDistance)
      Sets the inclusion of the inverted generational distance indicator collector.
      Parameters:
      includeInvertedGenerationalDistance - true if the inverted generational distance indicator collector is included; false otherwise
    • getIncludeSpacing

      public boolean getIncludeSpacing()
      Returns true if the spacing indicator collector is included; false otherwise.
      Returns:
      true if the spacing indicator collector is included; false otherwise
    • setIncludeSpacing

      public void setIncludeSpacing(boolean includeSpacing)
      Sets the inclusion of the spacing indicator collector.
      Parameters:
      includeSpacing - true if the spacing indicator collector is included; false otherwise
    • getIncludeAdditiveEpsilonIndicator

      public boolean getIncludeAdditiveEpsilonIndicator()
      Returns true if the additive ε-indicator collector is included; false otherwise.
      Returns:
      true if the additive ε-indicator collector is included; false otherwise
    • setIncludeAdditiveEpsilonIndicator

      public void setIncludeAdditiveEpsilonIndicator(boolean includeAdditiveEpsilonIndicator)
      Sets the inclusion of the additive ε-indicator collector.
      Parameters:
      includeAdditiveEpsilonIndicator - true if the additive ε-indicator collector is included; false otherwise
    • getIncludeContribution

      public boolean getIncludeContribution()
      Returns true if the contribution indicator collector is included; false otherwise.
      Returns:
      true if the contribution indicator collector is included; false otherwise
    • setIncludeContribution

      public void setIncludeContribution(boolean includeContribution)
      Sets the inclusion of the contribution indicator collector.
      Parameters:
      includeContribution - true if the contribution indicator collector is included; false otherwise
    • getIncludeR1

      public boolean getIncludeR1()
      Returns true if the R1 indicator collector is included; false otherwise.
      Returns:
      true if the R1 indicator collector is included; false otherwise
    • setIncludeR1

      public void setIncludeR1(boolean includeR1)
      Sets the inclusion of the R1 indicator collector.
      Parameters:
      includeR1 - true if the R1 indicator collector is included; false otherwise
    • getIncludeR2

      public boolean getIncludeR2()
      Returns true if the R2 indicator collector is included; false otherwise.
      Returns:
      true if the R2 indicator collector is included; false otherwise
    • setIncludeR2

      public void setIncludeR2(boolean includeR2)
      Sets the inclusion of the R2 indicator collector.
      Parameters:
      includeR2 - true if the R2 indicator collector is included; false otherwise
    • getIncludeR3

      public boolean getIncludeR3()
      Returns true if the R3 indicator collector is included; false otherwise.
      Returns:
      true if the R3 indicator collector is included; false otherwise
    • setIncludeR3

      public void setIncludeR3(boolean includeR3)
      Sets the inclusion of the R3 indicator collector.
      Parameters:
      includeR3 - true if the R3 indicator collector is included; false otherwise
    • getIncludeEpsilonProgress

      public boolean getIncludeEpsilonProgress()
      Returns true if the ε-progress collector is included; false otherwise.
      Returns:
      true if the ε-progress collector is included; false otherwise
    • setIncludeEpsilonProgress

      public void setIncludeEpsilonProgress(boolean includeEpsilonProgress)
      Sets the inclusion of the ε-progress collector.
      Parameters:
      includeEpsilonProgress - true if the ε-progress collector is included; false otherwise
    • getIncludeAdaptiveMultimethodVariation

      public boolean getIncludeAdaptiveMultimethodVariation()
      Returns true if the adaptive multimethod variation collector is included; false otherwise.
      Returns:
      true if the adaptive multimethod variation collector is included; false otherwise
    • setIncludeAdaptiveMultimethodVariation

      public void setIncludeAdaptiveMultimethodVariation(boolean includeAdaptiveMultimethodVariation)
      Sets the inclusion of the adaptive multimethod variation collector.
      Parameters:
      includeAdaptiveMultimethodVariation - true if the adaptive multimethod variation collector is included; false otherwise
    • getIncludeAdaptiveTimeContinuation

      public boolean getIncludeAdaptiveTimeContinuation()
      Returns true if the adaptive time continuation collector is included; false otherwise.
      Returns:
      true if the adaptive time continuation collector is included; false otherwise
    • setIncludeAdaptiveTimeContinuation

      public void setIncludeAdaptiveTimeContinuation(boolean includeAdaptiveTimeContinuation)
      Sets the inclusion of the adaptive time continuation collector.
      Parameters:
      includeAdaptiveTimeContinuation - true if the adaptive time continuation collector is included; false otherwise
    • getIncludeElapsedTime

      public boolean getIncludeElapsedTime()
      Returns true if the elapsed time collector is included; false otherwise.
      Returns:
      true if the elapsed time collector is included; false otherwise
    • setIncludeElapsedTime

      public void setIncludeElapsedTime(boolean includeElapsedTime)
      Sets the inclusion of the elapsed time collector.
      Parameters:
      includeElapsedTime - true if the elapsed time collector is included; false otherwise
    • getIncludeApproximationSet

      public boolean getIncludeApproximationSet()
      Returns true if the approximation set collector is included; false otherwise.
      Returns:
      true if the approximation set collector is included; false otherwise
    • setIncludeApproximationSet

      public void setIncludeApproximationSet(boolean includeApproximationSet)
      Sets the inclusion of the approximation set collector.
      Parameters:
      includeApproximationSet - true if the approximation set collector is included; false otherwise
    • getIncludePopulationSize

      public boolean getIncludePopulationSize()
      Returns true if the population size collector is included; false otherwise.
      Returns:
      true if the population size collector is included; false otherwise
    • setIncludePopulationSize

      public void setIncludePopulationSize(boolean includePopulationSize)
      Sets the inclusion of the population size collector.
      Parameters:
      includePopulationSize - true if the population size collector is included; false otherwise
    • 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
    • getShowIndividualTraces

      public boolean getShowIndividualTraces()
      Returns true if individual traces are shown; false if quantiles are shown.
      Returns:
      true if individual traces are shown; false if quantiles are shown
    • setShowIndividualTraces

      public void setShowIndividualTraces(boolean showIndividualTraces)
      Set to true to show individual traces; false to show quantiles.
      Parameters:
      showIndividualTraces - true to show individual traces; false to show quantiles
    • handleException

      protected void handleException(Exception e)
      Handles an exception, possibly displaying a dialog box containing details of the exception.
      Parameters:
      e - the exception