jopt.csp.spi
Class SolverImpl

java.lang.Object
  extended byjopt.csp.CspSolver
      extended byjopt.csp.spi.SolverImpl

public class SolverImpl
extends jopt.csp.CspSolver

Class that is used to construct and solve CSP problems. The solver can be based on various different CSP algorithms and searching techniques, but has default algorithms if the user does not wish to override these options.

Author:
Nick Coleman

Constructor Summary
SolverImpl()
           
 
Method Summary
 void addConstraint(jopt.csp.variable.CspBooleanExpr bool)
           
 void addConstraint(jopt.csp.variable.CspConstraint constraint)
           
 void addConstraint(jopt.csp.variable.CspConstraint constraint, boolean keepAfterReset)
           
 void addConstraint(jopt.csp.variable.CspGenericBooleanExpr bool)
           
 void addVariable(jopt.csp.variable.CspVariable var)
           
 void clear()
           
static ChoicePointAlgorithm createDefaultAlgorithm()
          Creates a default AC5 algorithm used when a new solver is created (initiated) without specifying an algorithm.
 boolean getAutoPropagate()
           
 boolean nextSolution()
           
 boolean propagate()
           
 void reset()
           
 void restoreNeighboringSolution(jopt.csp.solution.SolverSolution initial, jopt.csp.solution.SolverSolution neighbor)
           
 void restoreSolution(jopt.csp.solution.SolverSolution solution)
           
 void setAutoPropagate(boolean autoPropagate)
           
 boolean solve(jopt.csp.search.SearchAction action, jopt.csp.search.SearchGoal goal, jopt.csp.search.SearchTechnique technique, boolean continuallyImprove, boolean reset)
           
 boolean solve(jopt.csp.search.Search search, boolean reset)
           
 void storeSolution(jopt.csp.solution.SolverSolution solution)
           
 
Methods inherited from class jopt.csp.CspSolver
createSolver, createSolver, createSolver, createSolver, getLocalSearch, getSearchActions, getSearchGoals, getSearchLimits, getSearchTechniques, getVarFactory, restoreSolution, solve, solve, solve, solve, solve, solve, solve, solve, solve, solve, solve, solve, solve, solve, solve, storeSolution
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SolverImpl

public SolverImpl()
Method Detail

createDefaultAlgorithm

public static ChoicePointAlgorithm createDefaultAlgorithm()
Creates a default AC5 algorithm used when a new solver is created (initiated) without specifying an algorithm.


getAutoPropagate

public boolean getAutoPropagate()

setAutoPropagate

public void setAutoPropagate(boolean autoPropagate)

propagate

public boolean propagate()

addVariable

public void addVariable(jopt.csp.variable.CspVariable var)

addConstraint

public void addConstraint(jopt.csp.variable.CspConstraint constraint)
                   throws jopt.csp.variable.PropagationFailureException
Throws:
jopt.csp.variable.PropagationFailureException

addConstraint

public void addConstraint(jopt.csp.variable.CspConstraint constraint,
                          boolean keepAfterReset)
                   throws jopt.csp.variable.PropagationFailureException
Throws:
jopt.csp.variable.PropagationFailureException

addConstraint

public void addConstraint(jopt.csp.variable.CspBooleanExpr bool)
                   throws jopt.csp.variable.PropagationFailureException
Throws:
jopt.csp.variable.PropagationFailureException

addConstraint

public void addConstraint(jopt.csp.variable.CspGenericBooleanExpr bool)
                   throws jopt.csp.variable.PropagationFailureException
Throws:
jopt.csp.variable.PropagationFailureException

clear

public void clear()

reset

public void reset()

solve

public boolean solve(jopt.csp.search.Search search,
                     boolean reset)

solve

public boolean solve(jopt.csp.search.SearchAction action,
                     jopt.csp.search.SearchGoal goal,
                     jopt.csp.search.SearchTechnique technique,
                     boolean continuallyImprove,
                     boolean reset)

nextSolution

public boolean nextSolution()

storeSolution

public void storeSolution(jopt.csp.solution.SolverSolution solution)

restoreSolution

public void restoreSolution(jopt.csp.solution.SolverSolution solution)
                     throws jopt.csp.variable.PropagationFailureException
Throws:
jopt.csp.variable.PropagationFailureException

restoreNeighboringSolution

public void restoreNeighboringSolution(jopt.csp.solution.SolverSolution initial,
                                       jopt.csp.solution.SolverSolution neighbor)
                                throws jopt.csp.variable.PropagationFailureException
Throws:
jopt.csp.variable.PropagationFailureException