omnics
Class Backtracking

java.lang.Object
  extended by omnics.AbstractSolver
      extended by omnics.SystematicSolver
          extended by omnics.Backtracking
All Implemented Interfaces:
java.io.Serializable, Solver

public class Backtracking
extends SystematicSolver

A concrete implementation of SystematicSolver which uses a backtracking algorithm to explore the search space.

Author:
Cristian Frasinaru
See Also:
Serialized Form

Field Summary
 
Fields inherited from class omnics.SystematicSolver
assignmentStrategy, attempts, backtrackCounter, backwardStrategy, boundAlgorithm, candidates, candidatesMap, constraintsMap, DEBUG, domainsMap, eventHandler, explainer, failed, failures, filters, firingEvents, forwardStrategy, listeners, longestBacktrack, path, solutionMap, thrashing
 
Fields inherited from class omnics.AbstractSolver
analyzer, endTime, optimum, paused, problem, running, solution, solutions, solutionsLimit, startTime, timeLimit
 
Fields inherited from interface omnics.Solver
BENCHMARK_FORMAT, DETAILED_FORMAT
 
Constructor Summary
Backtracking(Problem problem)
          Creates a new instance of BackTracking
 
Method Summary
 void backTo(Var var)
          Goes back to a specified variable
 int filterAndPropagate(Var trigger)
          Applies filters and propagates changes.
 void forwardTo(Var var)
          Moves forward
 void instantiate(Var var, java.lang.Object val)
           
 void revoke(Var var)
          Revokes an instantiation done by the solver.
 TupleSet solveAll()
          Solves the problem and returns all solutions or null if no solution can be found
 
Methods inherited from class omnics.SystematicSolver
addFilter, addListener, assign, attempts, candidates, copyCandidates, copyConstraints, copyDomain, copySolution, current, explain, explain, explain, failures, getAssignmentStrategy, getBackwardStrategy, getBoundAlgorithm, getEventHandler, getExplainer, getFailed, getFilter, getFilters, getForwardStrategy, getListeners, initSolution, isApplyingFilters, isDynamicConstrained, isFiringEvents, isPaused, last, longestBacktrack, path, printResult, printResult, removeAllFilters, removeFilter, removeListener, resolveSingletons, restoreCandidates, restoreConstraints, restoreDomain, restoreProblem, restoreSolution, setApplyingFilters, setAssignmentStrategy, setBackwardStrategy, setBoundAlgorithm, setDynamicConstrained, setEventHandler, setExplainer, setFailed, setFiringEvents, setForwardStrategy, setListeners, setPaused, stop
 
Methods inherited from class omnics.AbstractSolver
eval, getAnalyzer, getEndTime, getProblem, getSolutionsLimit, getStartTime, getTimeLimit, isRunning, logResult, optimum, save, setAnalyzer, setEndTime, setProblem, setRunning, setSolutionsLimit, setStartTime, setTimeLimit, solution, solutions, solve, solve, time, timeToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Backtracking

public Backtracking(Problem problem)
Creates a new instance of BackTracking

Method Detail

solveAll

public final TupleSet solveAll()
Description copied from interface: Solver
Solves the problem and returns all solutions or null if no solution can be found

Specified by:
solveAll in interface Solver
Specified by:
solveAll in class AbstractSolver
Returns:
all solutions of the problem or null if the problem is inconsistent

forwardTo

public final void forwardTo(Var var)
Moves forward


instantiate

public final void instantiate(Var var,
                              java.lang.Object val)

backTo

public final void backTo(Var var)
Goes back to a specified variable


revoke

public final void revoke(Var var)
Revokes an instantiation done by the solver.


filterAndPropagate

public final int filterAndPropagate(Var trigger)
Applies filters and propagates changes.