Package de.uka.ipd.sdq.tcfmoop.tcmanager
Class TerminationCriteriaManager
java.lang.Object
de.uka.ipd.sdq.tcfmoop.tcmanager.TerminationCriteriaManager
- All Implemented Interfaces:
IRequestManualTerminationListener
,ITerminationCriteriaManager
,org.opt4j.core.optimizer.OptimizerIterationListener
The main goal of the Termination Criteria Manager is to create termination
criteria, call them so that they can evaluate the current optimization state
and then evaluate their decisions, on which it must base its own decision
whether to stop the optimization or not.
-
Constructor Summary
ConstructorDescriptionTerminationCriteriaManager
(org.opt4j.core.optimizer.Control control, org.opt4j.core.optimizer.Population population, org.opt4j.core.optimizer.Archive archive) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Activates Composed Criterion Mode in which multiple termination criteria can be stringed together to form a more powerful termination criterionvoid
Activates Termination Criteria Comparison Mode in which termination criteria decisions do not influence the optimization but are shown on the output.void
Removes a new listener for the OptimizationTerminated event.void
Adds a new listener for the OutputChanged event.static void
addTerminationCriteriaManagerInitializedListener
(ITerminationCriteriaManagerInitializedListener listener) Adds a new listener for the static TerminationCriteriaManagerInitialized event.void
If Composed Criterion is deactivated then a simple || condition is used to evaluate results from the different criteria.void
Deactivates Termination Criteria Comparison Mode in which termination criteria decisions are do not influence the optimization but are shown on the output.void
Evaluates the termination criteria and then stops the optimization if the specified conditions are met.void
Logic witch should be executed when a ManualTerminationRequest event is fired.void
initialize
(List<IConfiguration> tcConfigurations) Initializes the termination criteria manager by supplying it with a list of termination criteria configurations.void
iterationComplete
(org.opt4j.core.optimizer.Optimizer optimizer, int iteration) void
Removes a new listener for the OptimizationTerminated event.void
Removes a new listener for the OutputChanged event.static void
removeTerminationCriteriaManagerInitializedListener
(ITerminationCriteriaManagerInitializedListener listener) Removes a listener from the static TerminationCriteriaManagerInitialized event.void
setComposedCriterionExpression
(String composedCriterionExpression) Sets the expression used to define the relationship between the termination criterion.
-
Constructor Details
-
TerminationCriteriaManager
@Inject public TerminationCriteriaManager(org.opt4j.core.optimizer.Control control, org.opt4j.core.optimizer.Population population, org.opt4j.core.optimizer.Archive archive)
-
-
Method Details
-
initialize
Initializes the termination criteria manager by supplying it with a list of termination criteria configurations.- Specified by:
initialize
in interfaceITerminationCriteriaManager
-
activateTCComparisionMode
public void activateTCComparisionMode()Activates Termination Criteria Comparison Mode in which termination criteria decisions do not influence the optimization but are shown on the output.- Specified by:
activateTCComparisionMode
in interfaceITerminationCriteriaManager
-
deactivateTCComparisionMode
public void deactivateTCComparisionMode()Deactivates Termination Criteria Comparison Mode in which termination criteria decisions are do not influence the optimization but are shown on the output.- Specified by:
deactivateTCComparisionMode
in interfaceITerminationCriteriaManager
-
activateComposedCriterion
public void activateComposedCriterion()Activates Composed Criterion Mode in which multiple termination criteria can be stringed together to form a more powerful termination criterion- Specified by:
activateComposedCriterion
in interfaceITerminationCriteriaManager
-
deactivateComposedCriterion
public void deactivateComposedCriterion()If Composed Criterion is deactivated then a simple || condition is used to evaluate results from the different criteria.- Specified by:
deactivateComposedCriterion
in interfaceITerminationCriteriaManager
-
setComposedCriterionExpression
Sets the expression used to define the relationship between the termination criterion. If not set a standard Expression is used (Crit1 || Crit2 || Crit3 || Crit4 || ...)- Specified by:
setComposedCriterionExpression
in interfaceITerminationCriteriaManager
-
evaluateTerminationCriteria
public void evaluateTerminationCriteria()Evaluates the termination criteria and then stops the optimization if the specified conditions are met.- Specified by:
evaluateTerminationCriteria
in interfaceITerminationCriteriaManager
-
addOutputChangedListener
Adds a new listener for the OutputChanged event. If the listener is also a IRequestManualTerminationProvider. the TCM will add itself as a listener to that event.- Specified by:
addOutputChangedListener
in interfaceITerminationCriteriaManager
- Parameters:
listener
- IOutputChangedListener listener
-
removeOutputChangedListener
Removes a new listener for the OutputChanged event. If the listener is also a IRequestManualTerminationProvider. the TCM will remove itself as a listener from that event.- Specified by:
removeOutputChangedListener
in interfaceITerminationCriteriaManager
- Parameters:
listener
- IOutputChangedListener listener
-
addTerminationCriteriaManagerInitializedListener
public static void addTerminationCriteriaManagerInitializedListener(ITerminationCriteriaManagerInitializedListener listener) Adds a new listener for the static TerminationCriteriaManagerInitialized event.- Parameters:
listener
- ITerminationCriteriaManagerInitializedListener listener
-
removeTerminationCriteriaManagerInitializedListener
public static void removeTerminationCriteriaManagerInitializedListener(ITerminationCriteriaManagerInitializedListener listener) Removes a listener from the static TerminationCriteriaManagerInitialized event.- Parameters:
listener
- ITerminationCriteriaManagerInitializedListener listener
-
iterationComplete
public void iterationComplete(org.opt4j.core.optimizer.Optimizer optimizer, int iteration) - Specified by:
iterationComplete
in interfaceorg.opt4j.core.optimizer.OptimizerIterationListener
-
addOptimizationTerminatedListener
Removes a new listener for the OptimizationTerminated event.- Specified by:
addOptimizationTerminatedListener
in interfaceITerminationCriteriaManager
- Parameters:
listener
- IOptimizationTerminatedListener listener
-
removeOptimizationTerminatedListener
Removes a new listener for the OptimizationTerminated event.- Specified by:
removeOptimizationTerminatedListener
in interfaceITerminationCriteriaManager
- Parameters:
listener
- IOptimizationTerminatedListener listener
-
handleManualTerminationRequest
public void handleManualTerminationRequest()Logic witch should be executed when a ManualTerminationRequest event is fired.- Specified by:
handleManualTerminationRequest
in interfaceIRequestManualTerminationListener
-