choco.kernel.solver.search
Class AbstractOptimize

java.lang.Object
  extended by choco.kernel.solver.search.AbstractSearchStrategy
      extended by choco.kernel.solver.search.AbstractGlobalSearchStrategy
          extended by choco.kernel.solver.search.AbstractOptimize
All Implemented Interfaces:
ISearchMeasures, ISolutionMeasures
Direct Known Subclasses:
BranchAndBound, RealBranchAndBound

public abstract class AbstractOptimize
extends AbstractGlobalSearchStrategy


Field Summary
 boolean doMaximize
          a boolean indicating whether we want to maximize (true) or minimize (false) the objective variable
 Var objective
          the objective variable
protected  IObjectiveManager objManager
          the bounding object, record objective value and compute target bound.
 
Fields inherited from class choco.kernel.solver.search.AbstractGlobalSearchStrategy
baseWorld, currentTraceIndex, DOWN_BRANCH, encounteredLimit, INIT_SEARCH, initialPropagation, limitManager, mainGoal, nextMove, OPEN_NODE, RESTART, searchLoop, shavingTools, STOP, stopAtFirstSol, traceStack, UP_BRANCH
 
Fields inherited from class choco.kernel.solver.search.AbstractSearchStrategy
LOGGER, nbSolutions, solutionPool, solver
 
Constructor Summary
protected AbstractOptimize(Solver solver, IObjectiveManager bounds, boolean maximize)
          constructor
 
Method Summary
protected  void advancedInitialPropagation()
           
protected  void bottomUpSearch()
           
 IObjectiveManager getObjectiveManager()
           
 void incrementalRun()
          main entry point: searching for one solution Note: the initial propagation must be done before pushing any world level.
 void newFeasibleRootState()
          called when the root state of the search tree is feasible.
 Boolean nextSolution()
           
 String partialRuntimeStatistics(boolean logOnSolution)
           
 void postDynamicCut()
          we use targetBound data structures for the optimization cuts
 void recordSolution()
          called when a solution is encountered: printing and, if needed, storing the solution
 void restoreBestSolution()
           
 String runtimeStatistics()
           
 void writeSolution(Solution sol)
           
 
Methods inherited from class choco.kernel.solver.search.AbstractGlobalSearchStrategy
clearTrace, endTreeSearch, getBackTrackCount, getCurrentTraceIndex, getEncounteredLimit, getFailCount, getLimitManager, getNodeCount, getRestartCount, getReusableInitialTrace, getSearchLoop, getShavingTools, getTimeCount, getTrace, getTraceSize, initialPropagation, initialTrace, initMainGoal, isEncounteredLimit, isFeasibleRootState, isTraceEmpty, newTreeSearch, popTrace, pushTrace, setEncounteredLimit, setLimitManager, setSearchLoop, setShavingTools, topDownSearch, topTrace
 
Methods inherited from class choco.kernel.solver.search.AbstractSearchStrategy
existsSolution, getSolutionCount, getSolutionPool, getSolver, getStoredSolutions, resetSolutions, 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

doMaximize

public final boolean doMaximize
a boolean indicating whether we want to maximize (true) or minimize (false) the objective variable


objective

public final Var objective
the objective variable


objManager

protected final IObjectiveManager objManager
the bounding object, record objective value and compute target bound.

Constructor Detail

AbstractOptimize

protected AbstractOptimize(Solver solver,
                           IObjectiveManager bounds,
                           boolean maximize)
constructor

Parameters:
solver - the solver
maximize - maximization or minimization ?
configuration -
Method Detail

getObjectiveManager

public final IObjectiveManager getObjectiveManager()
Overrides:
getObjectiveManager in class AbstractGlobalSearchStrategy

newFeasibleRootState

public void newFeasibleRootState()
Description copied from class: AbstractGlobalSearchStrategy
called when the root state of the search tree is feasible.

Overrides:
newFeasibleRootState in class AbstractGlobalSearchStrategy

writeSolution

public void writeSolution(Solution sol)
Overrides:
writeSolution in class AbstractGlobalSearchStrategy

recordSolution

public void recordSolution()
Description copied from class: AbstractGlobalSearchStrategy
called when a solution is encountered: printing and, if needed, storing the solution

Overrides:
recordSolution in class AbstractGlobalSearchStrategy

postDynamicCut

public void postDynamicCut()
                    throws ContradictionException
we use targetBound data structures for the optimization cuts

Overrides:
postDynamicCut in class AbstractGlobalSearchStrategy
Throws:
ContradictionException

advancedInitialPropagation

protected void advancedInitialPropagation()
                                   throws ContradictionException
Overrides:
advancedInitialPropagation in class AbstractGlobalSearchStrategy
Throws:
ContradictionException

nextSolution

public Boolean nextSolution()
Overrides:
nextSolution in class AbstractGlobalSearchStrategy

bottomUpSearch

protected final void bottomUpSearch()

incrementalRun

public void incrementalRun()
Description copied from class: AbstractGlobalSearchStrategy
main entry point: searching for one solution Note: the initial propagation must be done before pushing any world level. It is therefore kept before restoring a solution

Overrides:
incrementalRun in class AbstractGlobalSearchStrategy

partialRuntimeStatistics

public String partialRuntimeStatistics(boolean logOnSolution)
Overrides:
partialRuntimeStatistics in class AbstractGlobalSearchStrategy

runtimeStatistics

public String runtimeStatistics()
Overrides:
runtimeStatistics in class AbstractGlobalSearchStrategy

restoreBestSolution

public void restoreBestSolution()
Overrides:
restoreBestSolution in class AbstractSearchStrategy


Copyright © 2012. All Rights Reserved.