choco.palm.dbt.search
Class PalmGlobalSearchSolver

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractSolver
          extended by choco.search.AbstractGlobalSearchSolver
              extended by choco.search.Solve
                  extended by choco.palm.dbt.search.PalmGlobalSearchSolver
All Implemented Interfaces:
Entity
Direct Known Subclasses:
PalmAbstractBranchAndBound

public class PalmGlobalSearchSolver
extends Solve

A default solver for Palm. By default, it uses mac-dbt algorithm (for extension and repairing).


Field Summary
protected  PalmExtend extending
          Extension algrithm using some branching strategies.
protected  boolean feasible
          States if the problem is feasible.
protected  boolean finished
          States if the search is finished.
protected  PalmLearn learning
          Learning algorithms.
static int LIMIT_NODES
           
static int LIMIT_TIME
           
protected  PalmRepair repairing
          Repairing algorithm.
protected  PalmState state
          Maintains the state of the search (past branching decisions).
 
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
PalmGlobalSearchSolver(AbstractProblem pb)
          Creates a solver for the specified problem.
 
Method Summary
 void attachPalmBranchings(java.util.List lbr)
          Attaches a new list of branching.
 void attachPalmExtend(PalmExtend ext)
          Attaches a new extension tool.
 void attachPalmLearn(PalmLearn ext)
          Attache a new learning tool.
 void attachPalmRepair(PalmRepair ext)
          Attaches a new PalmRepair algorithm.
 void attachPalmState(PalmState ext)
          Attaches a new PalmState to the solver.
 void endTreeSearch()
          called before a new search tree is explored
 void extend()
          Extends the state of the search thanks to the extending algorithm.
 PalmExtend getExtending()
          Gets the PalmExtend tool.
 PalmLearn getLearning()
          Gets the PalmLearn tool.
 IGlobalSearchLimit getLimit(int i)
           
 int getNbLimit()
           
 int getNodeLimit()
           
 PalmState getState()
          Gets the PalmState tool.
 int getTimeLimit()
           
 boolean isFinished()
          Chechs if the solver has finished searching a solution.
 void newTreeSearch()
          called before a new search tree is explored
 void recordSolution()
          Stores the current solution.
 void repair()
          Tries to repair the state for finding a consistent state.
 void reset()
          Resets the solver (statistics and business data).
 void run()
          Starts solving.
 void setFinished(boolean f)
          Sets if the solver has finished searching a solution.
 void setNodeLimit(int nodeLimit)
           
 void setTimeLimit(int timeLimit)
           
 
Methods inherited from class choco.search.AbstractGlobalSearchSolver
endTreeNode, getEncounteredLimit, incrementalRun, isEncounteredLimit, newTreeNode, nextSolution, popTrace, popTraceUntil, postDynamicCut, printRuntimeStatistics, pushTrace, 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

LIMIT_TIME

public static final int LIMIT_TIME
See Also:
Constant Field Values

LIMIT_NODES

public static final int LIMIT_NODES
See Also:
Constant Field Values

finished

protected boolean finished
States if the search is finished.


feasible

protected boolean feasible
States if the problem is feasible.


state

protected PalmState state
Maintains the state of the search (past branching decisions).


learning

protected PalmLearn learning
Learning algorithms.


extending

protected PalmExtend extending
Extension algrithm using some branching strategies.


repairing

protected PalmRepair repairing
Repairing algorithm.

Constructor Detail

PalmGlobalSearchSolver

public PalmGlobalSearchSolver(AbstractProblem pb)
Creates a solver for the specified problem. It initiliazes all contained structures (repairer, learner...).

Parameters:
pb - The problem to search.
Method Detail

newTreeSearch

public void newTreeSearch()
Description copied from class: AbstractGlobalSearchSolver
called before a new search tree is explored

Overrides:
newTreeSearch in class AbstractGlobalSearchSolver

endTreeSearch

public void endTreeSearch()
Description copied from class: AbstractGlobalSearchSolver
called before a new search tree is explored

Overrides:
endTreeSearch in class AbstractGlobalSearchSolver

reset

public void reset()
Resets the solver (statistics and business data).


attachPalmState

public void attachPalmState(PalmState ext)
Attaches a new PalmState to the solver.

Parameters:
ext - The PalmState that should be used for maintaining state of the search.

attachPalmExtend

public void attachPalmExtend(PalmExtend ext)
Attaches a new extension tool.


attachPalmBranchings

public void attachPalmBranchings(java.util.List lbr)
Attaches a new list of branching. It creates a linked list from the specified list of branching.


attachPalmLearn

public void attachPalmLearn(PalmLearn ext)
Attache a new learning tool.

Parameters:
ext - The learning extension the solver shoudl use.

attachPalmRepair

public void attachPalmRepair(PalmRepair ext)
Attaches a new PalmRepair algorithm.

Parameters:
ext - The new repairing algorithm the solver must use.

isFinished

public boolean isFinished()
Chechs if the solver has finished searching a solution.


setFinished

public void setFinished(boolean f)
Sets if the solver has finished searching a solution.

Parameters:
f - New value.

recordSolution

public void recordSolution()
Stores the current solution.

Overrides:
recordSolution in class AbstractGlobalSearchSolver

run

public void run()
Starts solving.

Overrides:
run in class AbstractGlobalSearchSolver

extend

public void extend()
            throws ContradictionException
Extends the state of the search thanks to the extending algorithm.

Throws:
ContradictionException

repair

public void repair()
            throws ContradictionException
Tries to repair the state for finding a consistent state.

Throws:
ContradictionException

getState

public PalmState getState()
Gets the PalmState tool.


getLearning

public PalmLearn getLearning()
Gets the PalmLearn tool.


getExtending

public PalmExtend getExtending()
Gets the PalmExtend tool.


getTimeLimit

public int getTimeLimit()

setTimeLimit

public void setTimeLimit(int timeLimit)

getNodeLimit

public int getNodeLimit()

setNodeLimit

public void setNodeLimit(int nodeLimit)

getLimit

public IGlobalSearchLimit getLimit(int i)

getNbLimit

public int getNbLimit()