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

SolutionProbability Class Reference

#include <SolutionProbability.h>

Inheritance diagram for SolutionProbability:

VariableOH ValueOH OrderingHeuristic OrderingHeuristic List of all members.

Public Types

typedef long double Real
typedef long double Real
enum  Preference { Minimum, Maximum }
enum  Preference { Minimum, Maximum }

Public Member Functions

 SolutionProbability (Decomposition &decomposition, const vector< pair< double, double > > &intervals, double quality=1, Preference preference=Maximum, bool analysis=false)
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)
 SolutionProbability (Decomposition &decomposition, const vector< pair< double, double > > &intervals, double quality=1, Preference preference=Minimum, bool dynamic=false)
virtual void select (vlist_type &selectable, vlist_type &selected)

Friends

bool SolutionProbabilityLT::operator() (const Value *value0, const Value *value1)
bool SolutionProbabilityGT::operator() (const Value *value0, const Value *value1)
bool SolutionProbabilityEQ::operator() (const Value *value0, const Value *value1)

Detailed Description

This value ordering heuristic returns the list of values that, when selected, maximize/minimize the probability of finding a solution in the remaining subproblem, after consistency is restored. Because of the requirement of restoring consistency, this heuristic is very expensive.


Member Enumeration Documentation

enum SolutionProbability::Preference
 

Enumeration values:
Minimum  Prefer the least probable solutions.
Maximum  Prefer the most probable solutions.

enum SolutionProbability::Preference
 

Enumeration values:
Minimum  Prefer the least probable solutions.
Maximum  Prefer the most probable solutions.


Constructor & Destructor Documentation

SolutionProbability::SolutionProbability 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.
quality the heuristic's quality, in the [0-1] range.
preference the solution probability preference.
analysis flag turning the heuristic analysis code on/off.

SolutionProbability::SolutionProbability Decomposition decomposition,
const vector< pair< double, double > > &  intervals,
double  quality = 1,
Preference  preference = Minimum,
bool  dynamic = 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.
quality the heuristic's quality, in the [0-1] range.
preference the solution probability preference.
dynamic `true' if the probability of a solution in the remaining subproblem is to be computed dynamically, `false' otherwise.


Member Function Documentation

bool SolutionProbability::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.

bool SolutionProbability::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 SolutionProbability::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 solution probability.

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 SolutionProbability::select vlist_type &  selectable,
vlist_type &  selected
[virtual]
 

Select the variables with the best solution probability, according to the current preference.

Parameters:
selectable the list of variables to select from.
selected selected variables should be moved here.

Implements VariableOH.

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

Select the values with the best probability of finding a solution, given the current preference (min/max).

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

Implements ValueOH.

void SolutionProbability::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:21 2005 for csp.kdevelop by  doxygen 1.3.9.1