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

OrderingHeuristic Class Reference

#include <OrderingHeuristic.h>

Inheritance diagram for OrderingHeuristic:

ConstraintOH ValueOH VariableOH Lexical Random Branching Conflicts Failures Lexical MinDomain Predefined Random SolutionProbability Branching Degree Domain DomainDegreeRatio DomainWeightedDegreeRatio DomainWipeouts Impact Lexical Predefined Random SolutionProbability WeightedDegree List of all members.

Public Member Functions

 OrderingHeuristic (const wstring &name, Decomposition &decomposition, const vector< pair< double, double > > &intervals, double quality=1)
const wstring & name () const
 Return the name of the heuristic.
bool inRange () const
const vector< pair< double,
double > > 
intervals () const
double quality () const
 Return the quality of the heuristic.
void recordCall ()
 Record the fact that the heuristic has been called.
ulonglong invocations () const
 Return the number of times this heuristic has been called.
virtual wostream & print (wostream &wos) const

Protected Attributes

Decompositionm_decomposition
 The decomposition using this heuristic.
vector< pair< double, double > > m_intervals
double m_quality
 The heuristic's quality in the [0-1] range.
ulonglong m_invocations
 The number of times this heuristic has been called.
vector< ulonglong > m_selectionSizes

Friends

CSP_API wostream & operator<< (wostream &wos, const OrderingHeuristic &orderingHeuristic)

Detailed Description

The super class of all the variable, value and constraint ordering heuristics.


Constructor & Destructor Documentation

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

Constructor for variable and value 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

bool OrderingHeuristic::inRange  )  const
 

Return `true' if the percentage of instantiated variable is in one of the intervals specified in the heuristic's constructor, `false' otherwise.

const vector<pair<double, double> > OrderingHeuristic::intervals  )  const [inline]
 

Return the search depth intervals for which the heuristic is active.

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

Print information about the heuristic at the given stream.

Parameters:
wos the output stream to print to.

Reimplemented in ConstraintOH, Domain, ValueOH, and VariableOH.


Member Data Documentation

vector<pair<double, double> > OrderingHeuristic::m_intervals [protected]
 

The search depths at which the heuristic should be activated, as a list of percentage intervals. For example, if the interval 10-20 is specified in intervals, that means that if between 10 and 20% of the total variables have been instantiated and this heuristic is called, it will actually do something.

vector<ulonglong> OrderingHeuristic::m_selectionSizes [protected]
 

Every time the heuristic selects `n' variables, values, or constraints out of the given list, it increments m_selectionSizes[n].


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