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

Predefined Class Reference

#include <Predefined.h>

Inheritance diagram for Predefined:

VariableOH ValueOH OrderingHeuristic OrderingHeuristic List of all members.

Public Member Functions

 Predefined (Decomposition &decomposition, const vector< vector< id_t > > &ids, const vector< pair< double, double > > &intervals, double quality=1)
virtual void init (const vlist_type &uninstantiatedVariables)
virtual void done ()
 Clean up the work done by `init()'.
virtual void select (Domain &selectable, Domain &selected, Variable &variable)
virtual long double score (Variable &variable, const Value &value)
size_t extraCalls () const
 Predefined (Decomposition &decomposition, const vector< vector< id_t > > &ids, const vector< pair< double, double > > &intervals, double quality=1)
virtual void init (const vlist_type &uninstantiatedVariables)
virtual void done ()
 Clean up the work done by `init()'.
virtual void select (vlist_type &selectable, vlist_type &selected)

Detailed Description

This value ordering heuristic selects a predefined value for the given selected variable at this depth.


Constructor & Destructor Documentation

Predefined::Predefined Decomposition decomposition,
const vector< vector< id_t > > &  ids,
const vector< pair< double, double > > &  intervals,
double  quality = 1
 

Constructor.

Parameters:
decomposition the decomposition using this heuristic.
ids the predefined selection order for each depth.
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.

Predefined::Predefined Decomposition decomposition,
const vector< vector< id_t > > &  ids,
const vector< pair< double, double > > &  intervals,
double  quality = 1
 

Constructor.

Parameters:
decomposition the decomposition using this heuristic.
ids the predefined selection order for each per depth.
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

size_t Predefined::extraCalls  )  const [inline]
 

Return the number of times the heuristic has been called after all the predefined values have been used.

Returns:
the number of extra calls.

virtual void Predefined::init const vlist_type &  uninstantiatedVariables  )  [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.

Reimplemented from ValueOH.

void Predefined::init const vlist_type &  uninstantiatedVariables  )  [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.

Reimplemented from ValueOH.

long double Predefined::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(). Useless for this heuristic, so this always returns 0.

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

Select from the given variable list the variable that is next in line in the heuristic's predefined list. This method looks at the variables in `selectable' and expects to find _all_ of them in its predefined assignment. It will return only _one_ variable in `selected', the one that is at the front of its list for the current depth.

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

Implements VariableOH.

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

Select from the given domain the predefined value for the given variable.

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.


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