MOEA Framework 2.12
API Specification

org.moeaframework.analysis.diagnostics
Class Controller

java.lang.Object
  extended by 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 Summary
Controller(DiagnosticTool frame)
          Constructs a new controller for the specified DiagnosticTool instance.
 
Method Summary
 void add(ResultKey key, Accumulator accumulator)
          Adds a new result to this controller.
 void add(String algorithm, String problem, Accumulator accumulator)
          Adds a new result to this controller.
 void addControllerListener(ControllerListener listener)
          Adds the specified listener to receive all subsequent controller events.
 void cancel()
          Notifies the controller that it should cancel the current evaluation job.
 void clear()
          Clears all results from this collector.
 void clearLastAccumulator()
          Clears the last accumulator.
protected  void fireEvent(ControllerEvent event)
          Fires the specified controller event.
protected  void fireModelChangedEvent()
          Fires a MODEL_CHANGED controller event.
protected  void fireProgressChangedEvent()
          Fires a PROGRESS_CHANGED controller event.
protected  void fireStateChangedEvent()
          Fires a STATE_CHANGED controller event.
protected  void fireViewChangedEvent()
          Fires a VIEW_CHANGED controller event.
 List<Accumulator> get(ResultKey key)
          Returns an unmodifiable collection containing the results associated with the specified key.
 boolean getIncludeAdaptiveMultimethodVariation()
          Returns true if the adaptive multimethod variation collector is included; false otherwise.
 boolean getIncludeAdaptiveTimeContinuation()
          Returns true if the adaptive time continuation collector is included; false otherwise.
 boolean getIncludeAdditiveEpsilonIndicator()
          Returns true if the additive ε-indicator collector is included; false otherwise.
 boolean getIncludeApproximationSet()
          Returns true if the approximation set collector is included; false otherwise.
 boolean getIncludeContribution()
          Returns true if the contribution indicator collector is included; false otherwise.
 boolean getIncludeElapsedTime()
          Returns true if the elapsed time collector is included; false otherwise.
 boolean getIncludeEpsilonProgress()
          Returns true if the ε-progress collector is included; false otherwise.
 boolean getIncludeGenerationalDistance()
          Returns true if the generational distance indicator collector is included; false otherwise.
 boolean getIncludeHypervolume()
          Returns true if the hypervolume indicator collector is included; false otherwise.
 boolean getIncludeInvertedGenerationalDistance()
          Returns true if the inverted generational distance indicator collector is included; false otherwise.
 boolean getIncludePopulationSize()
          Returns true if the population size collector is included; false otherwise.
 boolean getIncludeR1()
          Returns true if the R1 indicator collector is included; false otherwise.
 boolean getIncludeR2()
          Returns true if the R2 indicator collector is included; false otherwise.
 boolean getIncludeR3()
          Returns true if the R3 indicator collector is included; false otherwise.
 boolean getIncludeSpacing()
          Returns true if the spacing indicator collector is included; false otherwise.
 Set<ResultKey> getKeys()
          Returns an unmodifiable set of result keys contained in this controller.
 Accumulator getLastAccumulator()
          Returns the last accumulator to be generated; or null if no last accumulator exists or has been previously cleared.
 int getOverallProgress()
          Returns the overall progress of the current job being evaluated.
 int getRunProgress()
          Returns the run progress of the current job being evaluated.
 boolean getShowIndividualTraces()
          Returns true if individual traces are shown; false if quantiles are shown.
 boolean getShowLastTrace()
          Returns true if the last run's trace is displayed; false otherwise.
protected  void handleException(Exception e)
          Handles an exception, possibly displaying a dialog box containing details of the exception.
 boolean isRunning()
          Returns true if this controller is currently processing an evaluation job; false otherwise.
 void loadData(File file)
          Loads all results stored in the specified file.
 void removeControllerListener(ControllerListener listener)
          Removes the specified listener so it no longer receives controller events.
 void run()
          Launches a thread to run the current evaluation job.
 void saveData(File file)
          Saves all results stored in this controller to the specified file.
 void setIncludeAdaptiveMultimethodVariation(boolean includeAdaptiveMultimethodVariation)
          Sets the inclusion of the adaptive multimethod variation collector.
 void setIncludeAdaptiveTimeContinuation(boolean includeAdaptiveTimeContinuation)
          Sets the inclusion of the adaptive time continuation collector.
 void setIncludeAdditiveEpsilonIndicator(boolean includeAdditiveEpsilonIndicator)
          Sets the inclusion of the additive ε-indicator collector.
 void setIncludeApproximationSet(boolean includeApproximationSet)
          Sets the inclusion of the approximation set collector.
 void setIncludeContribution(boolean includeContribution)
          Sets the inclusion of the contribution indicator collector.
 void setIncludeElapsedTime(boolean includeElapsedTime)
          Sets the inclusion of the elapsed time collector.
 void setIncludeEpsilonProgress(boolean includeEpsilonProgress)
          Sets the inclusion of the ε-progress collector.
 void setIncludeGenerationalDistance(boolean includeGenerationalDistance)
          Sets the inclusion of the generational distance indicator collector.
 void setIncludeHypervolume(boolean includeHypervolume)
          Sets the inclusion of the hypervolume indicator collector.
 void setIncludeInvertedGenerationalDistance(boolean includeInvertedGenerationalDistance)
          Sets the inclusion of the inverted generational distance indicator collector.
 void setIncludePopulationSize(boolean includePopulationSize)
          Sets the inclusion of the population size collector.
 void setIncludeR1(boolean includeR1)
          Sets the inclusion of the R1 indicator collector.
 void setIncludeR2(boolean includeR2)
          Sets the inclusion of the R2 indicator collector.
 void setIncludeR3(boolean includeR3)
          Sets the inclusion of the R3 indicator collector.
 void setIncludeSpacing(boolean includeSpacing)
          Sets the inclusion of the spacing indicator collector.
 void setShowIndividualTraces(boolean showIndividualTraces)
          Set to true to show individual traces; false to show quantiles.
 void setShowLastTrace(boolean showLastTrace)
          Sets the display of the last run's trace.
 void showStatistics()
          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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller(DiagnosticTool frame)
Constructs a new controller for the specified DiagnosticTool instance.

Parameters:
frame - the DiagnosticTool instance using this controller
Method Detail

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,
                Accumulator accumulator)
Adds a new result to this controller. If the specified key already exists, the accumulator 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
accumulator - the accumulator storing the results

add

public void add(String algorithm,
                String problem,
                Accumulator accumulator)
Adds a new result to this controller. This method invokes add(ResultKey, Accumulator).

Parameters:
algorithm - the algorithm associated with these results
problem - the problem associated with these results
accumulator - the accumulator storing the results

clear

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


get

public List<Accumulator> 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

getLastAccumulator

public Accumulator getLastAccumulator()
Returns the last accumulator to be generated; or null if no last accumulator exists or has been previously cleared.

Returns:
the last accumulator to be generated; or null if no last accumulator exists or has been previously cleared

clearLastAccumulator

public void clearLastAccumulator()
Clears the last accumulator. Subsequent invocations of getLastAccumulator() will return null until a new accumulator 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

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!