I - The type of input instances (problems) to be solved by the algorithm.O - The type of output that is obtained by running the algorithm on the input.V - The type performance values will have to compare different solutions.public abstract class AOptimizer<I,O extends ScoredItem<V>,V extends java.lang.Comparable<V>> extends ASolutionCandidateIterator<I,O> implements IOptimizationAlgorithm<I,O,V>
| Modifier | Constructor and Description |
|---|---|
|
AOptimizer(I input)
C'tor taking only an input as a parameter.
|
protected |
AOptimizer(IAlgorithmConfig config,
I input)
C'tor taking a configuration of the algorithm and an input for the algorithm as arguments.
|
| Modifier and Type | Method and Description |
|---|---|
O |
call()
Overrides the call of Callable to restrict the set of allowed exceptions
|
O |
getBestSeenSolution() |
java.lang.String |
getLoggerName() |
O |
nextSolutionCandidate() |
SolutionCandidateFoundEvent<O> |
nextSolutionCandidateEvent() |
protected boolean |
setBestSeenSolution(O candidate)
Sets the best seen solution regardless the currently best solution.
|
void |
setLoggerName(java.lang.String name) |
protected boolean |
updateBestSeenSolution(O candidate)
Updates the best seen solution if the new solution is better.
|
collectAllSolutionsactivate, announceTimeoutDetected, avoidReinterruptionOnShutdownOnCurrentThread, cancel, checkAndConductTermination, checkTermination, computeTimeoutAware, getActivationTime, getConfig, getId, getInput, getNumCPUs, getRemainingTimeToDeadline, getState, getTimeout, getTimeoutPrecautionOffset, hasNext, hasThreadBeenInterruptedDuringShutdown, interruptThreadAsPartOfShutdown, isCanceled, isShutdownInitialized, isStopCriterionSatisfied, isTimeouted, iterator, next, post, registerActiveThread, registerListener, resolveShutdownInterruptOnCurrentThread, setConfig, setMaxNumThreads, setNumCPUs, setState, setTimeout, setTimeout, setTimeoutPrecautionOffset, shutdown, terminate, unregisterActiveThread, unregisterThreadAndShutdownclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfig, getId, getInput, getNumCPUs, getTimeout, nextWithException, registerListener, setMaxNumThreads, setNumCPUs, setTimeout, setTimeoutcancelpublic AOptimizer(I input)
input - The input of the algorithm.protected AOptimizer(IAlgorithmConfig config, I input)
config - The parameterization of the algorithm.input - The input to the algorithm (the problem to solve).protected boolean updateBestSeenSolution(O candidate)
candidate - A candidate for a new best seen solution. It is only updated iff the candidate performs better than the bestSeenSolution observed so far.protected boolean setBestSeenSolution(O candidate)
candidate - public O nextSolutionCandidate() throws java.lang.InterruptedException, AlgorithmExecutionCanceledException, AlgorithmTimeoutedException, AlgorithmException
nextSolutionCandidate in interface ISolutionCandidateIterator<I,O extends ScoredItem<V>>nextSolutionCandidate in class ASolutionCandidateIterator<I,O extends ScoredItem<V>>java.lang.InterruptedExceptionAlgorithmExecutionCanceledExceptionAlgorithmTimeoutedExceptionAlgorithmExceptionpublic SolutionCandidateFoundEvent<O> nextSolutionCandidateEvent() throws java.lang.InterruptedException, AlgorithmExecutionCanceledException, AlgorithmTimeoutedException, AlgorithmException
nextSolutionCandidateEvent in interface ISolutionCandidateIterator<I,O extends ScoredItem<V>>nextSolutionCandidateEvent in class ASolutionCandidateIterator<I,O extends ScoredItem<V>>java.lang.InterruptedExceptionAlgorithmExecutionCanceledExceptionAlgorithmTimeoutedExceptionAlgorithmExceptionpublic O getBestSeenSolution()
public O call() throws java.lang.InterruptedException, AlgorithmExecutionCanceledException, AlgorithmTimeoutedException, AlgorithmException
IAlgorithmcall in interface IAlgorithm<I,O extends ScoredItem<V>>call in interface java.util.concurrent.Callable<O extends ScoredItem<V>>call in class ASolutionCandidateIterator<I,O extends ScoredItem<V>>java.lang.InterruptedExceptionAlgorithmExecutionCanceledExceptionAlgorithmTimeoutedExceptionAlgorithmExceptionpublic java.lang.String getLoggerName()
getLoggerName in interface ILoggingCustomizablegetLoggerName in class AAlgorithm<I,O extends ScoredItem<V>>public void setLoggerName(java.lang.String name)
setLoggerName in interface ILoggingCustomizablesetLoggerName in class AAlgorithm<I,O extends ScoredItem<V>>