|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opt4j.core.optimizer.Control
public class Control
The Control allows to pause, stop, and terminate, the optimization
process.
The Optimizer calls the methods
TerminationException) or stopped (by the StopException). By
definition, a StopException might get thrown only between iterations,
a TerminationException also within an iteration of the optimization
algorithm. In this context, the optimization algorithm calls
checkpointStop() between the iterations and checkpoint()
within the iteration.
| Nested Class Summary | |
|---|---|
static class |
Control.State
The Control.State of the control. |
| Field Summary | |
|---|---|
protected java.util.Set<ControlListener> |
listeners
|
protected Control.State |
state
|
| Constructor Summary | |
|---|---|
Control()
|
|
| Method Summary | |
|---|---|
void |
addListener(ControlListener listener)
Adds a ControlListener. |
void |
checkpoint()
A checkpoint that checks for termination. |
void |
checkpointStop()
A checkpoint that checks for termination and stop. |
void |
doPause()
Pauses the optimization. |
void |
doStart()
Starts the optimization. |
void |
doStop()
Stops the optimization. |
void |
doTerminate()
Terminates the optimization. |
Control.State |
getState()
Returns the state. |
boolean |
isPaused()
Returns true if the optimization is paused. |
boolean |
isRunning()
Returns true if the optimization is running. |
boolean |
isStopped()
Returns true if the optimization is stopped. |
boolean |
isTerminated()
Returns true if the optimization is terminated. |
void |
removeListener(ControlListener listener)
Removes a ControlListener. |
protected void |
setState(Control.State state)
Sets the state and invokes listeners if the state has changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Control.State state
protected final java.util.Set<ControlListener> listeners
| Constructor Detail |
|---|
public Control()
| Method Detail |
|---|
public void doStart()
public void doPause()
public void doStop()
public void doTerminate()
public boolean isRunning()
true if the optimization is running.
true if the optimization is runningpublic boolean isPaused()
true if the optimization is paused.
true if the optimization is pausedpublic boolean isStopped()
true if the optimization is stopped.
true if the optimization is stoppedpublic boolean isTerminated()
true if the optimization is terminated.
true if the optimization is terminated
public void checkpoint()
throws TerminationException
TerminationException - if the optimization is terminated
public void checkpointStop()
throws TerminationException,
StopException
TerminationException - if the optimization is terminated
StopException - if the optimization is stoppedpublic Control.State getState()
protected void setState(Control.State state)
state - the desired statepublic void addListener(ControlListener listener)
ControlListener.
listener - the listener to addremoveListener(org.opt4j.core.optimizer.ControlListener)public void removeListener(ControlListener listener)
ControlListener.
listener - the listener to removeaddListener(org.opt4j.core.optimizer.ControlListener)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||