Main Page | Class Hierarchy | Class List | File List | Class Members

VariableOH Class Reference

#include <VariableOH.h>

Inheritance diagram for VariableOH:

OrderingHeuristic Branching Degree Domain DomainDegreeRatio DomainWeightedDegreeRatio DomainWipeouts Impact Lexical Predefined Random SolutionProbability WeightedDegree List of all members.

Public Member Functions

 VariableOH (const wstring &name, Decomposition &decomposition, const vector< pair< double, double > > &intervals, double quality=1)
virtual void init (const vlist_type &)
virtual void done ()
 Clean up the work done by `init()'.
virtual void select (vlist_type &selectable, vlist_type &selected)=0
virtual wostream & print (wostream &wos) const

Protected Member Functions

void selectByQuality (vlist_type &selectable, vlist_type &selected, StrictWeakVariableOrdering &better, StrictWeakVariableOrdering &equal)

Friends

CSP_API wostream & operator<< (wostream &wos, const VariableOH &variableOH)

Detailed Description

The super class of all the variable ordering heuristics.


Constructor & Destructor Documentation

VariableOH::VariableOH const wstring &  name,
Decomposition decomposition,
const vector< pair< double, double > > &  intervals,
double  quality = 1
 

Constructor for various variable ordering heuristics.

Parameters:
name the name of the heuristic.
decomposition the decomposition using this heuristic.
intervals the depth intervals where the heuristic is active; if no intervals are given, the heuristic is always active.
quality the heuristic's quality, in the [0-1] range.


Member Function Documentation

virtual void VariableOH::init const vlist_type &   )  [inline, virtual]
 

If any static computations or initializations are needed, they should be done here. Doing the static computations in the constructor would limit the heuristic to working only on the complete `Problem'. Doing it here allows the heuristic to be reused.

Parameters:
uninstantiatedVariables the list of variables that have not yet been instantiated in the decomposition.

Reimplemented in Predefined, Impact, and Predefined.

wostream & VariableOH::print wostream &  wos  )  const [virtual]
 

Print information about the heuristic at the given stream.

Parameters:
wos the output stream to print to.

Reimplemented from OrderingHeuristic.

Reimplemented in Domain.

virtual void VariableOH::select vlist_type &  selectable,
vlist_type &  selected
[pure virtual]
 

Each variable ordering heuristic object should implement this method which is supposed to get a list of variables and return another list of "preferred" variables among those in the original list. This method should NEVER return an empty list. The selected variables are removed from the original list. If the library's `g_predictable' flag is turned on, this function should expect the original list to be sorted by ID and should preserve that upon return. The list of selected variables should also be returned sorted if `g_predictable' is on.

Parameters:
selectable the list of variables to select from.
selected the list of selected variables.

Implemented in Branching, Degree, Domain, DomainDegreeRatio, DomainWeightedDegreeRatio, DomainWipeouts, Impact, Lexical, Predefined, Random, SolutionProbability, and WeightedDegree.

void VariableOH::selectByQuality vlist_type &  selectable,
vlist_type &  selected,
StrictWeakVariableOrdering &  better,
StrictWeakVariableOrdering &  equal
[protected]
 

Select the best variables according to the current preference and quality setting.

Parameters:
selectable the list of variables to select from.
selected selected variables should be moved here.
better the functor used to determine if an element should precede another one.
equal the functor used to determine if two elements are equal.


The documentation for this class was generated from the following files:
Generated on Wed May 25 12:21:23 2005 for csp.kdevelop by  doxygen 1.3.9.1