|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.solver.search.AbstractSearchStrategy
choco.kernel.solver.search.AbstractGlobalSearchStrategy
public abstract class AbstractGlobalSearchStrategy
An abstract class for controlling tree search in various ways version 2.0.3 : change the value of search constant to use bit masks.
Field Summary | |
---|---|
int |
baseWorld
the index of the world where the search started |
protected int |
currentTraceIndex
index of the current trace in the stack |
static int |
DOWN_BRANCH
|
protected AbstractGlobalSearchLimit |
encounteredLimit
indicates whether a limit was encountered in the alst incremental search |
static int |
INIT_SEARCH
constants for driving the incremental search algorithm |
protected long |
initialPropagation
|
GlobalSearchLimitManager |
limitManager
|
AbstractIntBranchingStrategy |
mainGoal
the goal that needs be solved to drive the exploration |
int |
nextMove
search controller: a flag storing the next move in the search tree |
static int |
OPEN_NODE
|
static int |
RESTART
|
AbstractSearchLoop |
searchLoop
|
ShavingTools |
shavingTools
|
static int |
STOP
|
boolean |
stopAtFirstSol
indicates whether the control should stop after the first solution is found |
protected IntBranchingTrace[] |
traceStack
a data structure storing the stack of choice contexts (for incremental search explorations) |
static int |
UP_BRANCH
|
Fields inherited from class choco.kernel.solver.search.AbstractSearchStrategy |
---|
LOGGER, nbSolutions, solutionPool, solver |
Constructor Summary | |
---|---|
protected |
AbstractGlobalSearchStrategy(Solver solver)
|
Method Summary | |
---|---|
protected void |
advancedInitialPropagation()
|
void |
clearTrace()
|
void |
endTreeSearch()
|
int |
getBackTrackCount()
Get the backtrack count of the measure |
int |
getCurrentTraceIndex()
|
AbstractGlobalSearchLimit |
getEncounteredLimit()
If a limit has been encounteres, return the involved limit |
int |
getFailCount()
Get the fail count of the measure |
GlobalSearchLimitManager |
getLimitManager()
|
int |
getNodeCount()
Get the node count of the measure |
IObjectiveManager |
getObjectiveManager()
|
int |
getRestartCount()
Get the restart count of the measure |
IntBranchingTrace |
getReusableInitialTrace()
|
AbstractSearchLoop |
getSearchLoop()
|
ShavingTools |
getShavingTools()
|
int |
getTimeCount()
Get the time count in milliseconds of the measure |
IntBranchingTrace |
getTrace(int index)
|
int |
getTraceSize()
|
void |
incrementalRun()
main entry point: searching for one solution Note: the initial propagation must be done before pushing any world level. |
void |
initialPropagation()
|
IntBranchingTrace |
initialTrace()
|
void |
initMainGoal(SConstraint c)
|
boolean |
isEncounteredLimit()
Checks if a limit has been encountered |
protected boolean |
isFeasibleRootState()
|
boolean |
isTraceEmpty()
|
void |
newFeasibleRootState()
called when the root state of the search tree is feasible. |
void |
newTreeSearch()
called before a new search tree is explored |
Boolean |
nextSolution()
|
String |
partialRuntimeStatistics(boolean logOnSolution)
|
IntBranchingTrace |
popTrace()
|
void |
postDynamicCut()
called before going down into each branch of the choice point |
IntBranchingTrace |
pushTrace()
|
void |
recordSolution()
called when a solution is encountered: printing and, if needed, storing the solution |
String |
runtimeStatistics()
|
void |
setEncounteredLimit(AbstractGlobalSearchLimit encounteredLimit)
|
void |
setLimitManager(GlobalSearchLimitManager limitManager)
|
void |
setSearchLoop(AbstractSearchLoop searchLoop)
|
void |
setShavingTools(ShavingTools shavingTools)
|
protected void |
topDownSearch()
|
IntBranchingTrace |
topTrace()
|
void |
writeSolution(Solution sol)
|
Methods inherited from class choco.kernel.solver.search.AbstractSearchStrategy |
---|
existsSolution, getSolutionCount, getSolutionPool, getSolver, getStoredSolutions, resetSolutions, restoreBestSolution, setSolutionPool |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface choco.kernel.solver.search.measure.ISearchMeasures |
---|
getSolutionCount |
Field Detail |
---|
public static final int INIT_SEARCH
public static final int OPEN_NODE
public static final int UP_BRANCH
public static final int DOWN_BRANCH
public static final int RESTART
public static final int STOP
protected int currentTraceIndex
protected IntBranchingTrace[] traceStack
public int nextMove
public final boolean stopAtFirstSol
protected AbstractGlobalSearchLimit encounteredLimit
public AbstractIntBranchingStrategy mainGoal
public int baseWorld
public ShavingTools shavingTools
public GlobalSearchLimitManager limitManager
public AbstractSearchLoop searchLoop
protected long initialPropagation
Constructor Detail |
---|
protected AbstractGlobalSearchStrategy(Solver solver)
Method Detail |
---|
public void initMainGoal(SConstraint c)
public IObjectiveManager getObjectiveManager()
public final GlobalSearchLimitManager getLimitManager()
public final AbstractSearchLoop getSearchLoop()
public final ShavingTools getShavingTools()
public final void setShavingTools(ShavingTools shavingTools)
public final void setSearchLoop(AbstractSearchLoop searchLoop)
public final void setLimitManager(GlobalSearchLimitManager limitManager)
protected final boolean isFeasibleRootState()
public final void initialPropagation()
protected void advancedInitialPropagation() throws ContradictionException
ContradictionException
protected final void topDownSearch()
public void incrementalRun()
public void newTreeSearch() throws ContradictionException
ContradictionException
public void newFeasibleRootState()
public void endTreeSearch()
public Boolean nextSolution()
public void writeSolution(Solution sol)
writeSolution
in class AbstractSearchStrategy
public void recordSolution()
recordSolution
in class AbstractSearchStrategy
public void postDynamicCut() throws ContradictionException
ContradictionException
public final IntBranchingTrace pushTrace()
public final boolean isTraceEmpty()
public final IntBranchingTrace getTrace(int index)
public final int getCurrentTraceIndex()
public final int getTraceSize()
public final IntBranchingTrace popTrace()
public final IntBranchingTrace initialTrace()
public final IntBranchingTrace getReusableInitialTrace()
public final IntBranchingTrace topTrace()
public final void clearTrace()
public String runtimeStatistics()
public String partialRuntimeStatistics(boolean logOnSolution)
public int getTimeCount()
ISearchMeasures
getTimeCount
in interface ISearchMeasures
public int getNodeCount()
ISearchMeasures
getNodeCount
in interface ISearchMeasures
public int getBackTrackCount()
ISearchMeasures
getBackTrackCount
in interface ISearchMeasures
public int getRestartCount()
ISearchMeasures
getRestartCount
in interface ISearchMeasures
public int getFailCount()
ISearchMeasures
getFailCount
in interface ISearchMeasures
public final boolean isEncounteredLimit()
public final AbstractGlobalSearchLimit getEncounteredLimit()
public final void setEncounteredLimit(AbstractGlobalSearchLimit encounteredLimit)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |