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

ConstraintOH Class Reference

#include <ConstraintOH.h>

Inheritance diagram for ConstraintOH:

OrderingHeuristic Lexical Random List of all members.

Public Member Functions

 ConstraintOH (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 (clist_type &selectable, clist_type &selected)=0
virtual wostream & print (wostream &wos) const

Friends

CSP_API wostream & operator<< (wostream &wos, const ConstraintOH &constraintOH)

Detailed Description

The super class of all the constraint ordering heuristics.


Constructor & Destructor Documentation

ConstraintOH::ConstraintOH const wstring &  name,
Decomposition decomposition,
const vector< pair< double, double > > &  intervals,
double  quality = 1
[inline]
 

Constructor for various constraint 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 ConstraintOH::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.

virtual wostream& ConstraintOH::print wostream &  wos  )  const [inline, virtual]
 

Print information about the heuristic at the given stream.

Parameters:
wos the output stream to print to.

Reimplemented from OrderingHeuristic.

virtual void ConstraintOH::select clist_type &  selectable,
clist_type &  selected
[pure virtual]
 

Each constraint ordering heuristic object should implement this method which is supposed to get a list of constraints and return another list of "preferred" constraints among those in the original list. This method should NEVER return an empty list. The selected constraints 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 constraints should also be returned sorted if `g_predictable' is on.

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

Implemented in Lexical, and Random.


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