choco.palm.dbt
Class PalmSolver

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.Solver
          extended by choco.palm.dbt.PalmSolver
All Implemented Interfaces:
Entity

public class PalmSolver
extends Solver

This class extends Solver as a factory for PaLM search solvers.


Field Summary
protected  java.util.List branchings
          Lists of the branchings that should be used by the generated solver.
protected  PalmExtend extend
          The extender class the generated solver should use to choose decision constraints during search.
protected  PalmLearn learn
          The learning class the generated solver should use to learn forbidden or authorized nodes during search.
protected  int prMoves
          Decision Repair: number of moves without improvment the decision repair algorithm should try before stopping.
protected  int prSize
          Decision Repair: number of explanations the decision repair algorithm should store.
protected  PalmRepair repair
          The repair class the generated solver should use to choose which decision constraints to remove for repairing.
protected  PalmState state
          The state class the generated solver should use to maintain the state of the search.
 
Fields inherited from class choco.Solver
doMaximize, firstSolution, loggingMaxDepth, nodeLimit, objective, PROPAGATION, restart, SEARCH, SILENT, SOLUTION, solver, timeLimit, valIterator, valSelector, varSelector
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Constructor Summary
PalmSolver(AbstractProblem pb)
          Creates a new solver factory for the specified problem
 
Method Summary
 void addGoal(PalmAbstractBranching br)
          Adds a new branching to the branching list to attach to the generated solver.
 void attachGoals(java.util.List lst)
          Attaches a list of goals -- or branching in the case of Palm -- that should be attched to the generated solver.
 void generateSearchSolver(AbstractProblem pb)
          The factory method: builds the solver needed to solve the problem (an optimization solver if a variable should be minimized or maximized, a classical solver (mac-dbt) for constraint problems, or a path-repair or decision-repair solver if explanations should be kept.
 java.lang.Number getOptimumValue()
           
 Solution getSolution(int i)
          Return the ith solutions.
 void launch()
          commands the solver to start
 void setPalmExtender(PalmExtend ext)
          Sets a custom extender to attach to the generated solver.
 void setPalmLearner(PalmLearn ext)
          Sets a custom learner to attach to the generated solver.
 void setPalmRepairer(PalmRepair ext)
          Sets a custom repairer to attach to the generated solver.
 void setPalmState(PalmState ext)
          Sets a custom state to attach to the generated solver.
 void setPathRepair()
           
 void setPathRepairValues(int size, int moves)
          Decision Repair Sets the maximal number of explanations stored and the maximal moves without improvement of the decision repair algorithm.
 
Methods inherited from class choco.Solver
addGoal, attachGoal, flushLog, flushLogs, generateGoal, getEncounteredLimit, getFirstSolution, getNbSolutions, getSearchSolver, isEncounteredLimit, setDoMaximize, setFirstSolution, setLoggingMaxDepth, setNodeLimit, setObjective, setRestart, setTimeLimit, setValIterator, setValSelector, setVarSelector, setVerbosity, setVerbosity
 
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

extend

protected PalmExtend extend
The extender class the generated solver should use to choose decision constraints during search.


state

protected PalmState state
The state class the generated solver should use to maintain the state of the search.


learn

protected PalmLearn learn
The learning class the generated solver should use to learn forbidden or authorized nodes during search.


repair

protected PalmRepair repair
The repair class the generated solver should use to choose which decision constraints to remove for repairing.


branchings

protected java.util.List branchings
Lists of the branchings that should be used by the generated solver.


prSize

protected int prSize
Decision Repair: number of explanations the decision repair algorithm should store.


prMoves

protected int prMoves
Decision Repair: number of moves without improvment the decision repair algorithm should try before stopping.

Constructor Detail

PalmSolver

public PalmSolver(AbstractProblem pb)
Creates a new solver factory for the specified problem

Parameters:
pb -
Method Detail

generateSearchSolver

public void generateSearchSolver(AbstractProblem pb)
The factory method: builds the solver needed to solve the problem (an optimization solver if a variable should be minimized or maximized, a classical solver (mac-dbt) for constraint problems, or a path-repair or decision-repair solver if explanations should be kept.

Overrides:
generateSearchSolver in class Solver
Parameters:
pb - The problem the solver should solve.

attachGoals

public void attachGoals(java.util.List lst)
Attaches a list of goals -- or branching in the case of Palm -- that should be attched to the generated solver.

Parameters:
lst - list of branchings (PalmAbstractBranching)

addGoal

public void addGoal(PalmAbstractBranching br)
Adds a new branching to the branching list to attach to the generated solver.

Parameters:
br -

getSolution

public Solution getSolution(int i)
Return the ith solutions.

Parameters:
i -
Returns:

setPalmExtender

public void setPalmExtender(PalmExtend ext)
Sets a custom extender to attach to the generated solver.


setPalmLearner

public void setPalmLearner(PalmLearn ext)
Sets a custom learner to attach to the generated solver.


setPalmState

public void setPalmState(PalmState ext)
Sets a custom state to attach to the generated solver.


setPalmRepairer

public void setPalmRepairer(PalmRepair ext)
Sets a custom repairer to attach to the generated solver.


setPathRepairValues

public void setPathRepairValues(int size,
                                int moves)
Decision Repair Sets the maximal number of explanations stored and the maximal moves without improvement of the decision repair algorithm.

Parameters:
size -
moves -

setPathRepair

public void setPathRepair()

getOptimumValue

public java.lang.Number getOptimumValue()
Overrides:
getOptimumValue in class Solver

launch

public void launch()
Description copied from class: Solver
commands the solver to start

Overrides:
launch in class Solver