#include <qecore.hh>
Inherited by Implicative.
Inheritance diagram for QSpace:
Public Member Functions | |
QECODE_EXPORT | QSpace () |
QECODE_EXPORT | QSpace (QSpace &qs) |
virtual QECODE_EXPORT | ~QSpace () |
QECODE_EXPORT int | nv () |
Returns the number of variablas. returns the number of variables this quantified space contains. | |
virtual bool | quantification (int v)=0 |
Returns a variable quantificaion. Returns wether a variable is quantified existentially (false) or universally (true). | |
virtual int | status (int var, unsigned long int &propsteps)=0 |
Returns the current partial status of the quantified space. Returns the current status of the quantified space, but limits the computation of this status at the variable given in parameter. So, this method will return "don't know" more often than a complete status computation. Returns 1 for "true", 0 for "false", and -1 for "Don't know, try a next variable". A "Don't know" answer while all the variables have been assigned can be considered as a "true". | |
virtual int | finalStatus (unsigned long int &propsteps)=0 |
Returns the thuth value of a completely assigned problem. Performs the last checks to return in a complete way the truth value of the problem. All non-subsumes variables must be assigned for this method to be correct. | |
virtual bool | subsumed (int var)=0 |
Returns wether a variable is subsumed or not. A variable is subsumed if it is assigned or it is bound by no more constraint. The answer must be correct, but not complete (so, a "not sure" must return False for the solver to remain correct. | |
virtual QSpace * | clone ()=0 |
virtual void | assign_int (int var, int **vals, int nbVals)=0 |
Assigns a set of value to an integer variable. assigns a set of value to an integer variable. Used only by the search engine. | |
virtual void | remove_int (int var, int **vals, int nbVals)=0 |
Removes a set of value to an integer variable. Removes a set of value to an integer variable. Used only by the search engine. | |
virtual void | assign_bool (int var, int **vals, int nbVals)=0 |
Assigns a set of value to an integer variable. assigns a set of value to an integer variable. Used only by the search engine. | |
virtual void | remove_bool (int var, int **vals, int nbVals)=0 |
Removes a set of value to an boolean variable. Removes a set of value to an boolean variable. Used only by the search engine. | |
virtual void | assign_bool (int var, int b)=0 |
Assigns a value to a boolean variable. assigns a set of value to an integer variable. Used only by the search engine. | |
virtual void | remove_bool (int var, int b)=0 |
Removes a value to a boolean variable. removes a set of value to an integer variable. Used only by the search engine. | |
virtual void | backtrack ()=0 |
Method called when the solver backtracks to this quantified space. This method is useful to indicate some new information to the branchong heuristic, like simply updating the scores. | |
virtual void | indicateBranchingHeuristic (BranchingHeuristic *bh)=0 |
Indicates the branching heuristic to be used when performing search. Indicates the branching heuristic to be used when performing search. This method is typically invoked by the solver at its construction. | |
virtual void | print ()=0 |
Print the space details to the default output. | |
Public Attributes | |
void ** | v |
Array of the variables of the quantified space. This array contains all the variables of the quantified space (with current domain). | |
VarType * | type_of_v |
Types of the variables of the quantified space. This aray contains the type of each variable (integer, boolean, etc.). | |
Protected Attributes | |
unsigned int | n |
unsigned long int | ps |
Definition at line 48 of file qecore.hh.
QSpace::QSpace | ( | ) |
QSpace::QSpace | ( | QSpace & | qs | ) |
virtual QECODE_EXPORT QSpace::~QSpace | ( | ) | [inline, virtual] |
QECODE_EXPORT int QSpace::nv | ( | ) | [inline] |
Returns the number of variablas. returns the number of variables this quantified space contains.
Definition at line 67 of file qecore.hh.
Referenced by BranchingHeuristic::BranchingHeuristic(), Implicative::print(), and QSolver::QSolver().
virtual bool QSpace::quantification | ( | int | v | ) | [pure virtual] |
Returns a variable quantificaion. Returns wether a variable is quantified existentially (false) or universally (true).
v | The variable number. |
Implemented in Implicative.
Referenced by BranchingHeuristic::BranchingHeuristic().
virtual int QSpace::status | ( | int | var, | |
unsigned long int & | propsteps | |||
) | [pure virtual] |
Returns the current partial status of the quantified space. Returns the current status of the quantified space, but limits the computation of this status at the variable given in parameter. So, this method will return "don't know" more often than a complete status computation. Returns 1 for "true", 0 for "false", and -1 for "Don't know, try a next variable". A "Don't know" answer while all the variables have been assigned can be considered as a "true".
var | The number of the variable to compute the status around. | |
propsteps | Will be increased by the number of propagation steps performed (for statistical purposes). |
Implemented in Implicative.
Referenced by QSolver::rSolve(), and QSolver::solve().
virtual int QSpace::finalStatus | ( | unsigned long int & | propsteps | ) | [pure virtual] |
Returns the thuth value of a completely assigned problem. Performs the last checks to return in a complete way the truth value of the problem. All non-subsumes variables must be assigned for this method to be correct.
propsteps | Will be increased by the number of propagation steps performed (for statistical purposes). |
Implemented in Implicative.
Referenced by QSolver::rSolve().
virtual bool QSpace::subsumed | ( | int | var | ) | [pure virtual] |
Returns wether a variable is subsumed or not. A variable is subsumed if it is assigned or it is bound by no more constraint. The answer must be correct, but not complete (so, a "not sure" must return False for the solver to remain correct.
var | The variable number. |
Implemented in Implicative.
Referenced by BranchingHeuristic::nextVar().
virtual QSpace* QSpace::clone | ( | ) | [pure virtual] |
Returns a clone of the quantified space (possibly after a propagation call)
Implemented in Implicative.
Referenced by QSolver::rSolve().
virtual void QSpace::assign_int | ( | int | var, | |
int ** | vals, | |||
int | nbVals | |||
) | [pure virtual] |
Assigns a set of value to an integer variable. assigns a set of value to an integer variable. Used only by the search engine.
var | The number of the variable to assign. | |
vals | The values to assign to this variable (represented y ranges). | |
nbVals | The number of ranges in vals. |
Implemented in Implicative.
Referenced by QSolver::rSolve().
virtual void QSpace::remove_int | ( | int | var, | |
int ** | vals, | |||
int | nbVals | |||
) | [pure virtual] |
Removes a set of value to an integer variable. Removes a set of value to an integer variable. Used only by the search engine.
var | The number of the variable to assign. | |
vals | The values to remove from this variable (represented y ranges). | |
nbVals | The number of ranges in vals. |
Implemented in Implicative.
Referenced by QSolver::rSolve().
virtual void QSpace::assign_bool | ( | int | var, | |
int ** | vals, | |||
int | nbVals | |||
) | [pure virtual] |
Assigns a set of value to an integer variable. assigns a set of value to an integer variable. Used only by the search engine.
var | The number of the variable to assign. | |
vals | The values to assign to this variable (represented y ranges). | |
nbVals | The number of ranges in vals. |
Implemented in Implicative.
Referenced by QSolver::rSolve().
virtual void QSpace::remove_bool | ( | int | var, | |
int ** | vals, | |||
int | nbVals | |||
) | [pure virtual] |
Removes a set of value to an boolean variable. Removes a set of value to an boolean variable. Used only by the search engine.
var | The number of the variable to assign. | |
vals | The values to remove from this variable (represented y ranges). | |
nbVals | The number of ranges in vals. |
Implemented in Implicative.
Referenced by QSolver::rSolve().
virtual void QSpace::assign_bool | ( | int | var, | |
int | b | |||
) | [pure virtual] |
Assigns a value to a boolean variable. assigns a set of value to an integer variable. Used only by the search engine.
var | The number of the variable to assign. | |
b | The value to assign to this variable. |
Implemented in Implicative.
virtual void QSpace::remove_bool | ( | int | var, | |
int | b | |||
) | [pure virtual] |
Removes a value to a boolean variable. removes a set of value to an integer variable. Used only by the search engine.
var | The number of the variable to assign. | |
b | The value to remove from this variable. |
Implemented in Implicative.
virtual void QSpace::backtrack | ( | ) | [pure virtual] |
Method called when the solver backtracks to this quantified space. This method is useful to indicate some new information to the branchong heuristic, like simply updating the scores.
Implemented in Implicative.
Referenced by QSolver::rSolve().
virtual void QSpace::indicateBranchingHeuristic | ( | BranchingHeuristic * | bh | ) | [pure virtual] |
Indicates the branching heuristic to be used when performing search. Indicates the branching heuristic to be used when performing search. This method is typically invoked by the solver at its construction.
Implemented in Implicative.
Referenced by QSolver::QSolver().
virtual void QSpace::print | ( | ) | [pure virtual] |
Print the space details to the default output.
Implemented in Implicative.
Referenced by QSolver::rSolve().
unsigned int QSpace::n [protected] |
unsigned long int QSpace::ps [protected] |
void** QSpace::v |
Array of the variables of the quantified space. This array contains all the variables of the quantified space (with current domain).
Definition at line 73 of file qecore.hh.
Referenced by Implicative::cascade(), Implicative::Implicative(), Implicative::makeStructure(), Implicative::print(), Implicative::QBoolVar(), Implicative::QIntVar(), QSpace(), SmallestDomainFirst::score(), and Implicative::subsumed().
Types of the variables of the quantified space. This aray contains the type of each variable (integer, boolean, etc.).
Definition at line 79 of file qecore.hh.
Referenced by Implicative::assign_bool(), Implicative::assign_int(), Implicative::cascade(), valueHeuristic::getBoolVar(), valueHeuristic::getIntVar(), Implicative::Implicative(), Implicative::makeStructure(), Implicative::QBoolVar(), Implicative::QIntVar(), QSpace(), Implicative::remove_bool(), Implicative::remove_int(), QSolver::rSolve(), SmallestDomainFirst::score(), LargestHalfFirst::subSet(), SmallestHalfFirst::subSet(), MedianValueFirst::subSet(), LargestValueFirst::subSet(), SmallestValueFirst::subSet(), FirstFailValue::subSet(), and Implicative::subsumed().