IStrategy
interface instead.@Deprecated public abstract class LocalSearchStrategyBase extends java.lang.Object implements IStrategy
IStrategy
implementation defines an exploration loop especially for local search based
exploration strategies, where a concrete strategy shall derive from this class and define the abstract methods
(template method design pattern):
Constructor and Description |
---|
LocalSearchStrategyBase()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
explore()
Deprecated.
This method explores the design space as the implementation specifies.
|
abstract ITransition |
getNextTransition(boolean lastWasSuccessful)
Deprecated.
Returns the next
ITransition to fire, the next step in the design space. |
abstract void |
init(ThreadContext context)
Deprecated.
Initializes the strategy, called once before the first
LocalSearchStrategyBase#getNextTransition(ThreadContext) is called for every new thread. |
void |
initStrategy(ThreadContext context)
Deprecated.
Initializes the strategy with a specific
ThreadContext . |
abstract void |
interrupted()
Deprecated.
Called if the exploration process is interrupted for example by timeout.
|
void |
interruptStrategy()
Deprecated.
The implementation of this interface should be ready to be interrupted.
|
abstract void |
newStateIsProcessed(boolean isAlreadyTraversed,
Fitness fitness,
boolean constraintsNotSatisfied)
Deprecated.
Called after the chosen transition is fired and the new state has been processed.
|
public abstract void init(ThreadContext context)
LocalSearchStrategyBase#getNextTransition(ThreadContext)
is called for every new thread.context
- The ThreadContext
which contains necessary informations. Should be assigned to a field.public abstract ITransition getNextTransition(boolean lastWasSuccessful)
ITransition
to fire, the next step in the design space. It can be a quite complex method
or a simple depth first search.lastWasSuccessful
- False if the last returned transition was already fired by someone and therefore should choose an
other transition, otherwise true.ITransition
which is not traversed yet. Null if there is no more to fire.public abstract void newStateIsProcessed(boolean isAlreadyTraversed, Fitness fitness, boolean constraintsNotSatisfied)
isAlreadyTraversed
- True if the new state is already traversed in the past.fitness
- A map containing the values of the objectives.areConstraintsSatisfied
- True if the new state doesn't satisfies the global constraints.public abstract void interrupted()
LocalSearchStrategyBase#getNextTransition(ThreadContext, boolean)
method witch is called right after this
one.public void initStrategy(ThreadContext context)
IStrategy
ThreadContext
.initStrategy
in interface IStrategy
context
- The context.public void explore()
IStrategy
public void interruptStrategy()
IStrategy
IStrategy.explore()
method should return ASAP.
This method is also called by the SolutionStore
class if enough solutions are found.interruptStrategy
in interface IStrategy