choco.search
Class AbstractOptimize

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractSolver
          extended by choco.search.AbstractGlobalSearchSolver
              extended by choco.search.AbstractOptimize
All Implemented Interfaces:
Entity
Direct Known Subclasses:
BranchAndBound, OptimizeWithRestarts

public abstract class AbstractOptimize
extends AbstractGlobalSearchSolver


Field Summary
 boolean doMaximize
          a boolean indicating whether we want to maximize (true) or minize (false) the objective variable
 int lowerBound
          the lower bound of the objective value.
 IntDomainVarImpl objective
          the variable modelling the objective value
 int targetLowerBound
          a tentative lower bound
 int targetUpperBound
          a tentative upper bound
 int upperBound
          the upper bound of the objective value This value comes from the problem definition; it is strengthened by the search history (solutions found & no-goods)
 
Fields inherited from class choco.search.AbstractGlobalSearchSolver
baseWorld, currentTraceIndex, DOWN_BRANCH, encounteredLimit, INIT_SEARCH, limits, loggingMaxDepth, mainGoal, nbSolutions, nextMove, OPEN_NODE, stopAtFirstSol, traceStack, UP_BRANCH
 
Fields inherited from class choco.AbstractSolver
logger, maxNbSolutionStored, solutions
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Constructor Summary
protected AbstractOptimize(IntDomainVarImpl obj, boolean maximize)
          constructor
 
Method Summary
 int getBestObjectiveValue()
           
 int getObjectiveTarget()
          the target for the objective function: we are searching for a solution at least as good as this (tentative bound)
 int getObjectiveValue()
          v1.0 accessing the objective value of an optimization problem (note that the objective value may not be instantiated, while all other variables are)
 void initBounds()
          initialization of the optimization bound data structure
 void postDynamicCut()
          we use targetBound data structures for the optimization cuts
 void postTargetBound()
          propagating the optimization cuts from the new target bounds
 void postTargetLowerBound()
           
 void postTargetUpperBound()
           
 void recordSolution()
          TODO
 void setBound()
          resetting the optimization bounds
 void setTargetBound()
          resetting the values of the target bounds (bounds for the remaining search)
protected  void setTargetLowerBound()
           
protected  void setTargetUpperBound()
           
 
Methods inherited from class choco.search.AbstractGlobalSearchSolver
endTreeNode, endTreeSearch, getEncounteredLimit, incrementalRun, isEncounteredLimit, newTreeNode, newTreeSearch, nextSolution, popTrace, popTraceUntil, printRuntimeStatistics, pushTrace, run, setLoggingMaxDepth, topTrace
 
Methods inherited from class choco.AbstractSolver
existsSolution, makeSolutionFromCurrentState, restoreBestSolution, showSolution, storeSolution
 
Methods inherited from class choco.AbstractEntity
getProblem, pretty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doMaximize

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


objective

public IntDomainVarImpl objective
the variable modelling the objective value


lowerBound

public int lowerBound
the lower bound of the objective value. This value comes from the problem definition; it is strengthened by the search history (solutions found & no-goods)


upperBound

public int upperBound
the upper bound of the objective value This value comes from the problem definition; it is strengthened by the search history (solutions found & no-goods)


targetUpperBound

public int targetUpperBound
a tentative upper bound


targetLowerBound

public int targetLowerBound
a tentative lower bound

Constructor Detail

AbstractOptimize

protected AbstractOptimize(IntDomainVarImpl obj,
                           boolean maximize)
constructor

Parameters:
obj - the objective variable
maximize - maximization or minimization ?
Method Detail

getObjectiveValue

public int getObjectiveValue()
v1.0 accessing the objective value of an optimization problem (note that the objective value may not be instantiated, while all other variables are)

Returns:
the current objective value

getBestObjectiveValue

public int getBestObjectiveValue()

getObjectiveTarget

public int getObjectiveTarget()
the target for the objective function: we are searching for a solution at least as good as this (tentative bound)


initBounds

public void initBounds()
initialization of the optimization bound data structure


recordSolution

public void recordSolution()
TODO

Overrides:
recordSolution in class AbstractGlobalSearchSolver

setBound

public void setBound()
resetting the optimization bounds


setTargetBound

public void setTargetBound()
resetting the values of the target bounds (bounds for the remaining search)


setTargetLowerBound

protected void setTargetLowerBound()

setTargetUpperBound

protected void setTargetUpperBound()

postTargetBound

public void postTargetBound()
                     throws ContradictionException
propagating the optimization cuts from the new target bounds

Throws:
ContradictionException

postTargetLowerBound

public void postTargetLowerBound()
                          throws ContradictionException
Throws:
ContradictionException

postTargetUpperBound

public void postTargetUpperBound()
                          throws ContradictionException
Throws:
ContradictionException

postDynamicCut

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

Overrides:
postDynamicCut in class AbstractGlobalSearchSolver
Throws:
ContradictionException