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

Random Class Reference

#include <Random.h>

Inheritance diagram for Random:

VariableOH ValueOH ConstraintOH OrderingHeuristic OrderingHeuristic OrderingHeuristic List of all members.

Public Member Functions

 Random (Decomposition &decomposition, Randomizer &randomizer, const vector< pair< double, double > > &intervals, double quality=1)
virtual void select (clist_type &selectable, clist_type &selected)
 Random (Decomposition &decomposition, Randomizer &randomizer, const vector< pair< double, double > > &intervals, double quality=1, 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)
 Random (Decomposition &decomposition, Randomizer &randomizer, const vector< pair< double, double > > &intervals, double quality=1)
virtual void select (vlist_type &selectable, vlist_type &selected)

Detailed Description

This constraint ordering heuristic selects a random constraint.


Constructor & Destructor Documentation

Random::Random Decomposition decomposition,
Randomizer &  randomizer,
const vector< pair< double, double > > &  intervals,
double  quality = 1
 

Constructor.

Parameters:
decomposition the decomposition using this heuristic.
randomizer the randomizer to be used to generate pseudo-random integers.
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; kinda nonsensical and useless here.

Random::Random Decomposition decomposition,
Randomizer &  randomizer,
const vector< pair< double, double > > &  intervals,
double  quality = 1,
bool  analysis = false
 

Constructor.

Parameters:
decomposition the decomposition using this heuristic.
randomizer the randomizer to be used to generate pseudo-random integers.
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; kinda nonsensical and useless here.
analysis `true' if the heuristic is to be analyzed.

Random::Random Decomposition decomposition,
Randomizer &  randomizer,
const vector< pair< double, double > > &  intervals,
double  quality = 1
 

Constructor.

Parameters:
decomposition the decomposition using this heuristic.
randomizer the randomizer to be used to generate pseudo-random integers.
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; kinda nonsensical and useless here.


Member Function Documentation

bool Random::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 Random::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 Random::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 Random::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 Random::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 random index.

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

Select a random variable from a list.

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

Implements VariableOH.

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

Select a random value from a domain.

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

Select a random constraint from a list.

Parameters:
selectable the constraints to select from.
selected the selected constraint will be moved here.

Implements ConstraintOH.

void Random::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