Differential Evolution C++ library
|
#include <de_constraints.hpp>
Classes | |
class | unique |
Public Member Functions | |
set_constraint (const de::DVector &values) | |
void | add_value (de::Double value) |
virtual double | get_rand_value () |
virtual double | get_rand_value (double value, double origin) |
double | min () const |
double | max () const |
virtual double | get_rand_value_in_zone (double origin, double zonePct) const |
virtual double | get_middle_point () |
A set constraint. Specifies that variables can take any values from a predefined set. Doesn't require min or max.
Note that duplicate values will be removed
de::set_constraint::set_constraint | ( | const de::DVector & | values | ) | [inline] |
Constructs the set from a vector of Double values, and removes duplicates to ensure a uniform distribution for randomization
values |
void de::set_constraint::add_value | ( | de::Double | value | ) | [inline] |
adds an individual value to the "set", won't create duplicate values.
value |
virtual double de::set_constraint::get_middle_point | ( | ) | [inline, virtual] |
Gets the point midway between min and max - will only work for range constraints
Implements de::constraint.
virtual double de::set_constraint::get_rand_value | ( | ) | [inline, virtual] |
returns a value randomly chosen from the set of available values
Implements de::constraint.
virtual double de::set_constraint::get_rand_value | ( | double | value, |
double | origin | ||
) | [inline, virtual] |
returns a value randomly chosen from the set of available values
Implements de::constraint.
virtual double de::set_constraint::get_rand_value_in_zone | ( | double | origin, |
double | zonePct | ||
) | const [inline, virtual] |
Gets a random value within the limits set for the constraint, but further limited to a range defined by its origin and the width of the zone around this origin in pct of the total width
origin | the origin (center) of the zone further limiting the constraint |
zonePct | the width of the zone in pct of the total width, around the origin |
Implements de::constraint.
double de::set_constraint::max | ( | ) | const [inline, virtual] |
double de::set_constraint::min | ( | ) | const [inline, virtual] |