Differential Evolution C++ library
de::set_constraint Class Reference

#include <de_constraints.hpp>

Inheritance diagram for de::set_constraint:
Collaboration diagram for de::set_constraint:

List of all members.

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 ()

Detailed Description

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

Author:
adrian (12/1/2011)

Constructor & Destructor Documentation

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

Author:
adrian (12/10/2011)
Parameters:
values

Member Function Documentation

void de::set_constraint::add_value ( de::Double  value) [inline]

adds an individual value to the "set", won't create duplicate values.

Author:
adrian (12/10/2011)
Parameters:
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

Author:
adrian (12/16/2011)
Returns:
double

Implements de::constraint.

virtual double de::set_constraint::get_rand_value ( ) [inline, virtual]

returns a value randomly chosen from the set of available values

Author:
adrian (12/4/2011)
Returns:
double

Implements de::constraint.

Here is the caller graph for this function:

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

Author:
adrian (12/4/2011)
Returns:
double

Implements de::constraint.

Here is the call graph for this function:

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

Author:
adrian (12/13/2011)
Parameters:
originthe origin (center) of the zone further limiting the constraint
zonePctthe width of the zone in pct of the total width, around the origin
Returns:
double

Implements de::constraint.

double de::set_constraint::max ( ) const [inline, virtual]

returns the max limit of the range

Author:
adrian (12/4/2011)
Returns:
double

Implements de::constraint.

double de::set_constraint::min ( ) const [inline, virtual]

returns the min limit of the range

Author:
adrian (12/4/2011)
Returns:
double

Implements de::constraint.


The documentation for this class was generated from the following file: