BranchingHeuristic Class Reference

Branching heurstic for a quantified space. Branching heuristic using a score attribuer to give the next variable. This branching heuristic keeps trace of the variables on which we have branched, and so requires a backtrack signal (send by the solver using its backtrack method). The next variable musi be (and is) chosen respect to the variables partial order in the prefix. Heaps are used to provide the next variable in logarithmic time. Variables declared as subsumed are ignored by the branching heuristic. More...

#include <qecore.hh>

Collaboration diagram for BranchingHeuristic:

Collaboration graph
[legend]
List of all members.

Public Member Functions

QECODE_EXPORT void updateVar (int pos, QSpace *qs)
QECODE_EXPORT BranchingHeuristic (QSpace *qs, VariableHeuristic *ev)
 Constructor for a branching heuristic. constructor for a branching heuristic on a quantified space, using a score attribuer.
QECODE_EXPORT int nextVar (QSpace *qs)
QECODE_EXPORT void backtrack (QSpace *qs)
QECODE_EXPORT void vartouched (int pos, QSpace *qs)

Private Attributes

int size
int blocks
int * bloc
stackint treated
cheapheaps
stackint touched
int * score
int curHeap
VariableHeuristiceval

Detailed Description

Branching heurstic for a quantified space. Branching heuristic using a score attribuer to give the next variable. This branching heuristic keeps trace of the variables on which we have branched, and so requires a backtrack signal (send by the solver using its backtrack method). The next variable musi be (and is) chosen respect to the variables partial order in the prefix. Heaps are used to provide the next variable in logarithmic time. Variables declared as subsumed are ignored by the branching heuristic.

Definition at line 203 of file qecore.hh.


Constructor & Destructor Documentation

BranchingHeuristic::BranchingHeuristic ( QSpace qs,
VariableHeuristic ev 
)

Constructor for a branching heuristic. constructor for a branching heuristic on a quantified space, using a score attribuer.

Parameters:
qs The quantified space the branching heuristic is for.
ev the variable heuristic this branching heuristic will use to determine the next variable

Definition at line 40 of file qecore.cc.

References bloc, blocks, curHeap, eval, heaps, Heap< C >::insert(), MARKER, QSpace::nv(), QSpace::quantification(), VariableHeuristic::score(), score, Heap< C >::setBounds(), size, touched, and treated.


Member Function Documentation

void BranchingHeuristic::updateVar ( int  pos,
QSpace qs 
)

Definition at line 107 of file qecore.cc.

References bloc, Heap< C >::decrease(), eval, heaps, Heap< C >::increase(), score, and VariableHeuristic::score().

Referenced by backtrack(), and vartouched().

int BranchingHeuristic::nextVar ( QSpace qs  ) 

Returns the next variable to branch on.

Parameters:
qs The current quantified space on which we are searching (must be a clone, possibly cloned, propagated and assigned multiple times of the quantified space given at the construction.)

Definition at line 84 of file qecore.cc.

References blocks, curHeap, Heap< C >::getmin(), Heap< C >::getminwopop(), heaps, MARKER, QSpace::subsumed(), touched, and treated.

Referenced by QSolver::rSolve().

void BranchingHeuristic::backtrack ( QSpace qs  ) 

Used by the solver to indicate it backtracked.

Parameters:
qs The current quantified space on which we are searching, i.e. the one on which the solver just backtracked (must be a clone, possibly cloned, propagated and assigned multiple times of the quantified space given at the construction).

Definition at line 127 of file qecore.cc.

References bloc, curHeap, heaps, Heap< C >::insert(), MARKER, touched, treated, and updateVar().

Referenced by QSolver::rSolve().

void BranchingHeuristic::vartouched ( int  pos,
QSpace qs 
)

Used by the solver to indicate that a variable has been touched, and so thai its scors have possibly changed.

Parameters:
qs The current quantified space on which we are searching (must be a clone, possibly cloned, propagated and assigned multiple times of the quantified space given at the construction).

Definition at line 122 of file qecore.cc.

References touched, and updateVar().

Referenced by Warner::warn().


Member Data Documentation

int BranchingHeuristic::size [private]

Definition at line 205 of file qecore.hh.

Referenced by BranchingHeuristic().

int BranchingHeuristic::blocks [private]

Definition at line 206 of file qecore.hh.

Referenced by BranchingHeuristic(), and nextVar().

int* BranchingHeuristic::bloc [private]

Definition at line 207 of file qecore.hh.

Referenced by backtrack(), BranchingHeuristic(), and updateVar().

stackint BranchingHeuristic::treated [private]

Definition at line 208 of file qecore.hh.

Referenced by backtrack(), BranchingHeuristic(), and nextVar().

cheap* BranchingHeuristic::heaps [private]

Definition at line 209 of file qecore.hh.

Referenced by backtrack(), BranchingHeuristic(), nextVar(), and updateVar().

stackint BranchingHeuristic::touched [private]

Definition at line 210 of file qecore.hh.

Referenced by backtrack(), BranchingHeuristic(), nextVar(), and vartouched().

int* BranchingHeuristic::score [private]

Definition at line 211 of file qecore.hh.

Referenced by BranchingHeuristic(), and updateVar().

int BranchingHeuristic::curHeap [private]

Definition at line 212 of file qecore.hh.

Referenced by backtrack(), BranchingHeuristic(), and nextVar().

VariableHeuristic* BranchingHeuristic::eval [private]

Definition at line 213 of file qecore.hh.

Referenced by BranchingHeuristic(), and updateVar().


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