QSolver Class Reference

Depth-first search engine for quantified spaces. A quite naive depth-first search engine for quantified spaces. The answer of such an engine is true or false. The complete winning strategy, if existing, is not given. More...

#include <qsolver.hh>

Collaboration diagram for QSolver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

QECODE_EXPORT QSolver (QSpace *sp, VariableHeuristic *ev, valueHeuristic *ve)
 Constructor for a quantified space solver. Builds, providing a quantified space and a score for this space, a solver for this space.
QECODE_EXPORT bool solve (unsigned long int &nodes, unsigned long int &propsteps)
 Solves the quantified space. Solves the quantifies dpace, returning its solution. The parameters are used to provide statistics.

Private Member Functions

bool rSolve (QSpace *qs, unsigned long int &nodes, unsigned long int &propsteps, int curvar)

Private Attributes

bool debug
int n
QSpacesp
int * nbRanges
BranchingHeuristicbh
VariableHeuristiceval
valueHeuristicvalEval

Detailed Description

Depth-first search engine for quantified spaces. A quite naive depth-first search engine for quantified spaces. The answer of such an engine is true or false. The complete winning strategy, if existing, is not given.

Definition at line 43 of file qsolver.hh.


Constructor & Destructor Documentation

QSolver::QSolver ( QSpace sp,
VariableHeuristic ev,
valueHeuristic ve 
)

Constructor for a quantified space solver. Builds, providing a quantified space and a score for this space, a solver for this space.

Parameters:
sp The quantified space to be solved.
ev The score attribuer ("evaluator") that will be used by the branching heuristic.

Definition at line 28 of file qsolver.cc.

References bh, debug, eval, QSpace::indicateBranchingHeuristic(), n, nbRanges, QSpace::nv(), sp, and valEval.


Member Function Documentation

bool QSolver::rSolve ( QSpace qs,
unsigned long int &  nodes,
unsigned long int &  propsteps,
int  curvar 
) [private]

Definition at line 46 of file qsolver.cc.

References QSpace::assign_bool(), QSpace::assign_int(), BranchingHeuristic::backtrack(), QSpace::backtrack(), bh, QSpace::clone(), QSpace::finalStatus(), n, nbRanges, BranchingHeuristic::nextVar(), QSpace::print(), QSpace::remove_bool(), QSpace::remove_int(), QSpace::status(), valueHeuristic::subSet(), QSpace::type_of_v, valEval, VTYPE_BOOL, and VTYPE_INT.

Referenced by solve().

bool QSolver::solve ( unsigned long int &  nodes,
unsigned long int &  propsteps 
)

Solves the quantified space. Solves the quantifies dpace, returning its solution. The parameters are used to provide statistics.

Parameters:
nodes The integer referenced will be increased by the number of nodes of the search tree explored.
propsteps The integer references will be increased by the total number of propagation steps (in the Gecode sense) performed during search.

Definition at line 40 of file qsolver.cc.

References rSolve(), sp, and QSpace::status().

Referenced by main().


Member Data Documentation

bool QSolver::debug [private]

Definition at line 46 of file qsolver.hh.

Referenced by QSolver().

int QSolver::n [private]

Definition at line 47 of file qsolver.hh.

Referenced by QSolver(), and rSolve().

QSpace* QSolver::sp [private]

Definition at line 48 of file qsolver.hh.

Referenced by QSolver(), and solve().

int* QSolver::nbRanges [private]

Definition at line 49 of file qsolver.hh.

Referenced by QSolver(), and rSolve().

BranchingHeuristic* QSolver::bh [private]

Definition at line 50 of file qsolver.hh.

Referenced by QSolver(), and rSolve().

VariableHeuristic* QSolver::eval [private]

Definition at line 51 of file qsolver.hh.

Referenced by QSolver().

valueHeuristic* QSolver::valEval [private]

Definition at line 52 of file qsolver.hh.

Referenced by QSolver(), and rSolve().


The documentation for this class was generated from the following files:
Generated on Thu Feb 7 14:34:27 2008 for qecode by  doxygen 1.5.2