Package de.uka.ipd.sdq.tcfmoop.tcmanager
Interfaces and implementation of the Termination Criteria Manager.
The Termination Criteria Manager is provided with Configuration objects and uses these to create a set of Termination Criteria.
Every iteration the Termination Criteria Manager Executes the configured Termination Criteria and uses their results to decide whether the optimization should be stopped or not.
Prepares the output information.
Fires and handles events to communicate with the surrounding environment:
If the configurations and settings part of the communication is left aside, the way the architecture communicates with the outside world is by firing and handling different events:
TerminationCriteriaManagerInitializedEvent: The event is fired by the Termination Criteria Manager right after its initialization and is practically there to tell all interested entities that the manager has been initialized. Due to the fact that the Termination Criteria architecture must work not only as an Eclipse plug-in but also as a stand alone, reusable software entity, the methods for registering and unregistering listeners for this event are static, so that they could be accessed previous to the creation of the instance of the Termination Criteria Manager.
After the initialization of the Termination Criteria Manager, other classes can listen for and handle the following events:
OutputChangedEventThe event is fired by the Termination Criteria Manager every time the state of the manager changes. Usually, this happens after every iteration. The event handling methods receive a reference to the current output tree. The add and remove event methods that are currently implemented in the architecture also check the instance of the listener that wants to register. In case the listener class is capable of firing RequestManualTermination events, then the Termination Criteria Manager will automatically register for this event. This is usually the case, when the listener is some sort of User Interface.
OptimizationTerminatedEvent: This event is fired by the Termination Criteria Manager right after it has stopped the optimization. This can either be the result of handling a manual termination request event or of a stopping criteria suggesting the termination of the optimization process.
As mentioned above, the Termination Criteria Manager can handle a manual termination request by stopping the optimization after the completion of the next optimization step.
-
Class Summary Class Description TerminationCriteriaManager 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.