public class MainGeneticStrategy extends LocalSearchStrategyBase implements IStoreChild
Constructor and Description |
---|
MainGeneticStrategy(GeneticSharedObject sharedObject) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(ThreadContext context) |
GeneticDebugger |
getGeneticDebugger() |
ITransition |
getNextTransition(boolean lastWasSuccesful)
Returns the next
ITransition to fire, the next step in the design space. |
java.lang.String |
getTrajectoriesFileName() |
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.
|
void |
newStateIsProcessed(boolean isAlreadyTraversed,
Fitness fitness,
boolean constraintsNotSatisfied)
Called after the chosen transition is fired and the new state has been processed.
|
void |
saveTrajectoriesToFile() |
void |
setGeneticDebugger(GeneticDebugger geneticDebugger) |
void |
setTrajectoriesFileName(java.lang.String fileName) |
explore, initStrategy, interruptStrategy
public MainGeneticStrategy(GeneticSharedObject sharedObject)
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 lastWasSuccesful)
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
lastWasSuccesful
- 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 fitness, boolean constraintsNotSatisfied)
LocalSearchStrategyBase
newStateIsProcessed
in class LocalSearchStrategyBase
isAlreadyTraversed
- True if the new state is already traversed in the past.fitness
- A map containing the values of the objectives.public void interrupted()
LocalSearchStrategyBase
LocalSearchStrategyBase#getNextTransition(ThreadContext, boolean)
method witch is called right after this
one.interrupted
in class LocalSearchStrategyBase
public void addChild(ThreadContext context)
addChild
in interface IStoreChild
public void setGeneticDebugger(GeneticDebugger geneticDebugger)
public GeneticDebugger getGeneticDebugger()
public void setTrajectoriesFileName(java.lang.String fileName)
setTrajectoriesFileName
in interface IStoreChild
public java.lang.String getTrajectoriesFileName()
getTrajectoriesFileName
in interface IStoreChild
public void saveTrajectoriesToFile() throws java.io.IOException
saveTrajectoriesToFile
in interface IStoreChild
java.io.IOException