LocalSearchStrategyBase
abstract class.@Deprecated public class SingleObjectiveSolutionStore extends java.lang.Object implements ISolutionStore
ISolutionStore.StopExecutionType
Constructor and Description |
---|
SingleObjectiveSolutionStore(java.lang.String key)
Deprecated.
It stores only the best solution (with highest fitness) found so far.
|
SingleObjectiveSolutionStore(java.lang.String key,
int solutionsToStore)
Deprecated.
It stores the given number of best solutions (with highest fitness) found so far.
|
SingleObjectiveSolutionStore(java.lang.String key,
int solutionsToStore,
java.util.Comparator<java.lang.Double> comparator)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<Solution> |
getSolutions()
Deprecated.
Returns the currently stored solutions.
|
boolean |
isStrategyDependent()
Deprecated.
If an
ISolutionStore is exploration strategy dependent the framework passes the responsibility of calling
the ISolutionStore.newSolution(ThreadContext) method to the LocalSearchStrategyBase implementation. |
ISolutionStore.StopExecutionType |
newSolution(ThreadContext context)
Deprecated.
Notifies the solution store of a potential solution trajectory.
|
void |
registerSolutionFoundHandler(ISolutionFoundHandler handler)
Deprecated.
Registers a handler for executing custom code after a solution is found.
|
public SingleObjectiveSolutionStore(java.lang.String key)
key
- The key in the measurements Mappublic SingleObjectiveSolutionStore(java.lang.String key, int solutionsToStore)
key
- The key in the measurements MapsolutionsToStore
- The number of solutions to store.public SingleObjectiveSolutionStore(java.lang.String key, int solutionsToStore, java.util.Comparator<java.lang.Double> comparator)
key
- The key in the measurements MapsolutionsToStore
- The number of solutions to store.comparator
- A comparator to compare the objective values. It can be used to store a solutions with the least
fitness or with the least difference from a certain number instead of the utmost solutions.public ISolutionStore.StopExecutionType newSolution(ThreadContext context)
ISolutionStore
objectives
will never be
null and the implementation should be thread safe.
Also it determines whether the execution should stop or not, if a solution is found. It can have three different responses:
ISolutionStore.StopExecutionType.CONTINUE
: the execution should continue.ISolutionStore.StopExecutionType.STOP_THREAD
: this execution thread should be stopped while the others can continue.
ISolutionStore.StopExecutionType.STOP_ALL
: the whole design space exploration process should exit.newSolution
in interface ISolutionStore
context
- Context with the actual state of the exploration process.ISolutionStore.StopExecutionType
based on it's internal reasoning.public java.util.Collection<Solution> getSolutions()
ISolutionStore
getSolutions
in interface ISolutionStore
Solution
s.public void registerSolutionFoundHandler(ISolutionFoundHandler handler)
ISolutionStore
registerSolutionFoundHandler
in interface ISolutionStore
handler
- The handler.public boolean isStrategyDependent()
ISolutionStore
ISolutionStore
is exploration strategy dependent the framework passes the responsibility of calling
the ISolutionStore.newSolution(ThreadContext)
method to the LocalSearchStrategyBase
implementation.isStrategyDependent
in interface ISolutionStore