public class PredefinedPopulationSelector extends InitialPopulationSelector
Constructor and Description |
---|
PredefinedPopulationSelector(java.util.List<java.util.List<java.lang.Object>> trajectories) |
PredefinedPopulationSelector(java.lang.String fileName) |
Modifier and Type | Method and Description |
---|---|
ITransition |
getNextTransition(boolean lastWasSuccessful)
Returns the next
ITransition to fire, the next step in the design space. |
void |
init(ThreadContext context)
Initializes the strategy, called once before the first
LocalSearchStrategyBase#getNextTransition(ThreadContext) is called for every new thread. |
void |
interrupted()
Called if the exploration process is interrupted for example by timeout.
|
boolean |
isSilentFail() |
void |
newStateIsProcessed(boolean isAlreadyTraversed,
Fitness objectives,
boolean constraintsNotSatisfied)
Called after the chosen transition is fired and the new state has been processed.
|
void |
setChildStore(IStoreChild store)
The initial population selector must call the
IStoreChild.addChild(org.eclipse.viatra.dse.base.ThreadContext) method when a potentially good trajectory
is found. |
void |
setPopulationSize(int populationSize)
Sets the populations size in the initialization phase.
|
void |
setSilentFail(boolean silentFail) |
explore, initStrategy, interruptStrategy
public PredefinedPopulationSelector(java.util.List<java.util.List<java.lang.Object>> trajectories)
public PredefinedPopulationSelector(java.lang.String fileName) throws java.io.IOException
java.io.IOException
public void setChildStore(IStoreChild store)
InitialPopulationSelector
IStoreChild.addChild(org.eclipse.viatra.dse.base.ThreadContext)
method when a potentially good trajectory
is found.setChildStore
in class InitialPopulationSelector
store
- An interface with the call back method.public void init(ThreadContext context)
LocalSearchStrategyBase
LocalSearchStrategyBase#getNextTransition(ThreadContext)
is called for every new thread.init
in class LocalSearchStrategyBase
context
- The ThreadContext
which contains necessary informations. Should be assigned to a field.public ITransition getNextTransition(boolean lastWasSuccessful)
LocalSearchStrategyBase
ITransition
to fire, the next step in the design space. It can be a quite complex method
or a simple depth first search.getNextTransition
in class LocalSearchStrategyBase
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 void newStateIsProcessed(boolean isAlreadyTraversed, Fitness objectives, boolean constraintsNotSatisfied)
LocalSearchStrategyBase
newStateIsProcessed
in class LocalSearchStrategyBase
isAlreadyTraversed
- True if the new state is already traversed in the past.objectives
- A map containing the values of the objectives.public void setPopulationSize(int populationSize)
InitialPopulationSelector
IStoreChild
implementation.setPopulationSize
in class InitialPopulationSelector
populationSize
- Expected number of children.public void interrupted()
LocalSearchStrategyBase
LocalSearchStrategyBase#getNextTransition(ThreadContext, boolean)
method witch is called right after this
one.interrupted
in class LocalSearchStrategyBase
public boolean isSilentFail()
public void setSilentFail(boolean silentFail)