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

MinDomain Class Reference

#include <MinDomain.h>

Inheritance diagram for MinDomain:

ValueOH OrderingHeuristic List of all members.

Public Types

enum  Preference { Minimum, Maximum }

Public Member Functions

 MinDomain (Decomposition &decomposition, const vector< pair< double, double > > &intervals, double quality=1, Preference preference=Maximum, bool analysis=false)
virtual void dynamicInit (Variable &variable, Domain &selectable)
virtual void dynamicDone (Variable &variable)
virtual void select (Domain &selectable, Domain &selected, Variable &variable)
virtual bool better (const Value &value0, const Value &value1)
virtual bool equal (const Value &value0, const Value &value1)
virtual void sort (Domain &original, Domain &sorted, Variable &variable)
virtual long double score (Variable &variable, const Value &value)

Detailed Description

This value ordering heuristic selects the value with the minimum/maximum post-propagation minimum domain size. This is similar to heuristics::variables::Branching, see the comment there.


Member Enumeration Documentation

enum MinDomain::Preference
 

Enumeration values:
Minimum  Prefer the smallest post-propagation minimum domain size.
Maximum  Prefer the biggest post-propagation minimum domain size.


Constructor & Destructor Documentation

MinDomain::MinDomain Decomposition decomposition,
const vector< pair< double, double > > &  intervals,
double  quality = 1,
Preference  preference = Maximum,
bool  analysis = false
 

Constructor.

Parameters:
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.
preference `Minimum' if the value with the smallest post-propagation minimum domain size is to be preferred, `Maximum if the value with the largest post-propagation minimum domain size is to be preferred.
quality the heuristic's quality, in the [0-1] range.
analysis `true' if the heuristic is to be analyzed.


Member Function Documentation

bool MinDomain::better const Value value0,
const Value value1
[virtual]
 

Compare two values.

Parameters:
value0 the first value.
value1 the second value.
Returns:
`true' if value0 is strictly better than value1, `false' otherwise.

Reimplemented from ValueOH.

void MinDomain::dynamicDone Variable variable  )  [virtual]
 

Any dynamic clean up of the data structures required by the value selection should be performed here.

Parameters:
variable the variable for which the selection is done.

Reimplemented from ValueOH.

void MinDomain::dynamicInit Variable variable,
Domain selectable
[virtual]
 

Any dynamic initializations required by the value selection should be performed here.

Parameters:
variable the variable for which the selection is done.
selectable the domain to select values from.

Reimplemented from ValueOH.

bool MinDomain::equal const Value value0,
const Value value1
[virtual]
 

Compare two values for equality.

Parameters:
value0 the first value.
value1 the second value.
Returns:
`true' if value0 is as good as value1, `false' otherwise.

Reimplemented from ValueOH.

long double MinDomain::score Variable variable,
const Value value
[virtual]
 

Return the score of a value. The score is a number based on which the value's position is determined in Decomposition::selectValue(). The better the value, the greater the score should be. Here the score is computed based on the post-propagation minimum domain size.

Parameters:
variable the variable to which the value belongs.
value the value whose score is to be calculated.
Returns:
the value's score, as a floating point number.

Implements ValueOH.

void MinDomain::select Domain selectable,
Domain selected,
Variable variable
[virtual]
 

Select from the given domain the value that has the minimum/maximum post-propagation minimum domain size.

Parameters:
selectable the domain to select values from.
selected the selected value will be moved here.
variable the variable for which the selection is done.

Implements ValueOH.

void MinDomain::sort Domain original,
Domain sorted,
Variable variable
[virtual]
 

Sort the domain of the variable and place the result in a new Domain object.

Reimplemented from ValueOH.


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