public class Opt4JTask extends Task implements ControlListener, OptimizerIterationListener
Opt4JTask executes one optimization process.TaskTask.State| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closeOnStop |
protected com.google.inject.Injector |
injector |
protected boolean |
isClosed |
protected Optimizer |
optimizer |
protected com.google.inject.Injector |
parentInjector |
| Constructor and Description |
|---|
Opt4JTask()
Constructs a
Opt4JTask. |
Opt4JTask(boolean closeOnStop)
Constructs a
Opt4JTask. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the task.
|
void |
execute()
Executes the
Task. |
protected com.google.inject.Injector |
getInjector()
Returns the
Injector of the task. |
<O> O |
getInstance(java.lang.Class<O> type)
Returns the instance of the given class.
|
int |
getIteration()
Returns the current iteration.
|
protected Optimizer |
getOptimizer()
Returns the
Optimizer of the task. |
void |
init(com.google.inject.Injector injector)
Initialize with a parent
Injector. |
void |
iterationComplete(int iteration)
Invoked if the
Optimizer completes an iteration. |
void |
open()
Initialize a task manually before executing it.
|
void |
stateChanged(Control.State state)
Invoked if the state of the
Control changes. |
addStateListener, call, getException, getModules, getState, init, init, removeStateListener, setState, toStringprotected Optimizer optimizer
protected com.google.inject.Injector injector
protected com.google.inject.Injector parentInjector
protected final boolean closeOnStop
protected boolean isClosed
@Inject public Opt4JTask()
Opt4JTask.public Opt4JTask(boolean closeOnStop)
Opt4JTask.closeOnStop - close automatically after optimizationpublic void execute()
throws java.lang.Exception
TaskTask.public void init(com.google.inject.Injector injector)
Injector.injector - the parent injectorpublic void close()
public void open()
public int getIteration()
public <O> O getInstance(java.lang.Class<O> type)
O - the type of classtype - the classprotected com.google.inject.Injector getInjector()
Injector of the task.protected Optimizer getOptimizer()
Optimizer of the task.public void stateChanged(Control.State state)
ControlListenerControl changes.stateChanged in interface ControlListenerstate - the current state of the optimization processpublic void iterationComplete(int iteration)
OptimizerIterationListenerOptimizer completes an iteration.iterationComplete in interface OptimizerIterationListeneriteration - the completed iteration