EvolvingObjects
|
Simple normal mutation of a std::vector of real values. More...
#include <eoNormalMutation.h>
Public Member Functions | |
eoNormalVecMutation (double _sigma, const double &_p_change=1.0) | |
(Default) Constructor. | |
eoNormalVecMutation (eoRealVectorBounds &_bounds, double _sigma, const double &_p_change=1.0) | |
Constructor with bounds. | |
virtual std::string | className () const |
The class name. | |
bool | operator() (EOT &_eo) |
Do it! | |
Private Attributes | |
std::vector< double > | sigma |
eoRealVectorBounds & | bounds |
double | p_change |
Simple normal mutation of a std::vector of real values.
The stDev is fixed - but it is passed ans stored as a reference, to enable dynamic mutations (see eoOenFithMutation below).
As for the bounds, the values are here folded back into the bounds. The other possiblity would be to iterate until we fall inside the bounds - but this sometimes takes a long time!!!
Definition at line 50 of file eoNormalMutation.h.
eoNormalVecMutation< EOT >::eoNormalVecMutation | ( | double | _sigma, |
const double & | _p_change = 1.0 |
||
) | [inline] |
(Default) Constructor.
The bounds are initialized with the global object that says: no bounds.
_sigma | the range for uniform nutation |
_p_change | the probability to change a given coordinate |
Definition at line 60 of file eoNormalMutation.h.
eoNormalVecMutation< EOT >::eoNormalVecMutation | ( | eoRealVectorBounds & | _bounds, |
double | _sigma, | ||
const double & | _p_change = 1.0 |
||
) | [inline] |
Constructor with bounds.
_bounds | an eoRealVectorBounds that contains the bounds |
_sigma | the range for uniform nutation |
_p_change | the probability to change a given coordinate |
for each component, the sigma is scaled to the range of the bound, if bounded
Definition at line 71 of file eoNormalMutation.h.
References eoRealBaseVectorBounds::isBounded().
bool eoNormalVecMutation< EOT >::operator() | ( | EOT & | _eo | ) | [inline, virtual] |
Do it!
_eo | The cromosome undergoing the mutation |
Implements eoUF< EOT &, bool >.
Definition at line 88 of file eoNormalMutation.h.
References eoRng::flip(), eoRealBaseVectorBounds::foldsInBounds(), and eoRng::normal().