#include <ValueOH.h>
Inheritance diagram for ValueOH:

Public Member Functions | |
| ValueOH (const wstring &name, Decomposition &decomposition, const vector< pair< double, double > > &intervals, double quality=1, bool analysis=false) | |
| virtual void | init (const vlist_type &) |
| virtual void | done () |
| Clean up the work done by `init()'. | |
| void | solutionFound (const Solution &solution) |
| virtual void | dynamicInit (Variable &, Domain &) |
| virtual void | dynamicDone (Variable &) |
| virtual void | select (Domain &selectable, Domain &selected, Variable &variable)=0 |
| 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)=0 |
| void | setDistance (size_t distance) |
| bool | analysisFlag () const |
| Return `true' if the analysis flag is turned on. | |
| virtual wostream & | print (wostream &wos) const |
Protected Member Functions | |
| void | selectByQuality (const Variable &variable, Domain &selectable, Domain &selected, StrictWeakValueOrdering &better, StrictWeakValueOrdering &equal) |
| void | selectByDistance (const Variable &variable, Domain &selectable, Domain &selected, StrictWeakValueOrdering &better) |
| void | sort (Domain &original, Domain &sorted, Variable &variable, StrictWeakValueOrdering &better, StrictWeakValueOrdering &equal) |
| int | distance (vector< Value * > &preferred, hash_set< const Value * > &perfect) const |
| void | printPerfectPositions (vector< Value * > &preferred, hash_set< const Value * > &perfect) const |
| wostringstream & | printScores (wostringstream &wos, Variable &variable, vector< Value * > &preferred) |
| Generate a string with the scores of all the values. | |
Protected Attributes | |
| bool | m_analysis |
| size_t | m_distance |
| The distance to be used in selectByDistance(). | |
Friends | |
| CSP_API wostream & | operator<< (wostream &wos, const ValueOH &valueOH) |
|
||||||||||||||||||||||||
|
Constructor for various value ordering heuristics.
|
|
||||||||||||
|
Compare two values. FIXME: The default implementation of this function simply aborts. Normally, this function should be pure virtual, but not all value ordering heuristics implement the quality based selection mechanism yet.
Reimplemented in Branching, Conflicts, Failures, Lexical, MinDomain, Random, and SolutionProbability. |
|
||||||||||||
|
Return the distance between the first preferred value and the first preferred one that is perfect.
|
|
|
Any dynamic clean up of the data structures required by the value selection should be performed here.
Reimplemented in Branching, Conflicts, MinDomain, and Random. |
|
||||||||||||
|
Any dynamic initializations required by the value selection should be performed here.
Reimplemented in Branching, Conflicts, MinDomain, and Random. |
|
||||||||||||
|
Compare two values for equality. FIXME: The default implementation of this function simply aborts. Normally, this function should be pure virtual, but not all value ordering heuristics implement the quality based selection mechanism yet.
Reimplemented in Branching, Conflicts, Failures, Lexical, MinDomain, Random, and SolutionProbability. |
|
|
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.
Reimplemented in Conflicts, Predefined, and Predefined. |
|
|
Print information about the heuristic at the given stream.
Reimplemented from OrderingHeuristic. |
|
||||||||||||
|
Print the index of each perfect value in the domain.
|
|
||||||||||||
|
Return the score of a value. The score is a number based on which the value's position is determined. The better the value, the greater the score should be.
Implemented in Branching, Conflicts, Failures, Lexical, MinDomain, Predefined, Random, and SolutionProbability. |
|
||||||||||||||||
|
Each value ordering heuristic object should implement this method which is supposed to get a domain of values and return another domain containing only the "preferred" values among those in the original domain. This method should NEVER return an empty list. The selected values are removed from the original domain. If the library's `g_predictable' flag is turned on, this function should expect the original domain to be sorted by ID and should preserve that upon return. The list of selected values should also be returned sorted if `g_predictable' is on. Note that when this function is called, the domain of `variable' is empty.
Implemented in Branching, Conflicts, Failures, Lexical, MinDomain, Predefined, Random, and SolutionProbability. |
|
||||||||||||||||||||
|
Select the best values according to the current preference and distance setting. Values are sorted according to the heuristic's preferrence, then the one at index `m_distance' is chosen.
|
|
||||||||||||||||||||||||
|
Select the best values according to the current preference and quality setting.
|
|
|
Set the distance to be used by the next call to selectByDistance(). If set to 0, heuristics will not use distance-based selection. |
|
|
Let this value ordering heuristic know that a solution has been found.
|
|
||||||||||||||||||||||||
|
Compute a sorted copy of a domain of a variable. Values are sorted based on how good the heuristic considers them to be.
|
|
||||||||||||||||
|
Compute a sorted copy of a domain of a variable. Values are sorted based on how good the heuristic considers them to be. FIXME: This function's default implementation simply aborts. Normally, this function should be pure virtual, but not all value ordering heuristics implement the quality based selection mechanism yet.
Reimplemented in Branching, Conflicts, Failures, Lexical, MinDomain, Random, and SolutionProbability. |
|
|
`true' if the heuristic's quality is to be analyzed. Requires preloading of all known problem solutions. See Decomposition::getPerfectValues() & Problem::add(Solution&). |
1.3.9.1