EvolvingObjects
eoNormalMutation< EOT > Class Template Reference

Simple normal mutation of a std::vector of real values. More...

#include <eoNormalMutation.h>

Inheritance diagram for eoNormalMutation< EOT >:
eoMonOp< EOT > eoOp< EOT > eoUF< EOT &, bool > eoFunctorBase unary_function eoOneFifthMutation< EOT >

List of all members.

Public Member Functions

 eoNormalMutation (double &_sigma, const double &_p_change=1.0)
 (Default) Constructor.
 eoNormalMutation (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!
double & Sigma ()
 Accessor to ref to sigma - for update and monitor.

Private Attributes

double & sigma
eoRealVectorBoundsbounds
double p_change

Detailed Description

template<class EOT>
class eoNormalMutation< EOT >

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 120 of file eoNormalMutation.h.


Constructor & Destructor Documentation

template<class EOT>
eoNormalMutation< EOT >::eoNormalMutation ( double &  _sigma,
const double &  _p_change = 1.0 
) [inline]

(Default) Constructor.

The bounds are initialized with the global object that says: no bounds.

Parameters:
_sigmathe range for uniform nutation
_p_changethe probability to change a given coordinate

Definition at line 131 of file eoNormalMutation.h.

template<class EOT>
eoNormalMutation< EOT >::eoNormalMutation ( eoRealVectorBounds _bounds,
double  _sigma,
const double &  _p_change = 1.0 
) [inline]

Constructor with bounds.

Parameters:
_boundsan eoRealVectorBounds that contains the bounds
_sigmathe range for uniform nutation
_p_changethe probability to change a given coordinate

Definition at line 140 of file eoNormalMutation.h.


Member Function Documentation

template<class EOT>
bool eoNormalMutation< EOT >::operator() ( EOT &  _eo) [inline, virtual]

Do it!

Parameters:
_eoThe cromosome undergoing the mutation

Implements eoUF< EOT &, bool >.

Reimplemented in eoOneFifthMutation< EOT >.

Definition at line 151 of file eoNormalMutation.h.

References eoRng::flip(), eoRealBaseVectorBounds::foldsInBounds(), and eoRng::normal().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends