Module cma :: Class FFWrapper :: Class ShiftedFitness
[hide private]
[frames] | no frames]

Class ShiftedFitness

source code

                     object --+        
                              |        
FFWrapper.FitnessTransformation --+    
                                  |    
     FFWrapper.TransformSearchSpace --+
                                      |
                                     FFWrapper.ShiftedFitness

f = cma.ShiftedFitness(cma.fcts.sphere) constructs a shifted sphere function, by default the shift is computed from class ConstRandnShift with std dev 3.
Instance Methods [hide private]
 
__init__(self, f, shift=None)
shift(x) must return a (stable) shift of x.
source code

Inherited from FitnessTransformation: __call__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, f, shift=None)
(Constructor)

source code 

shift(x) must return a (stable) shift of x.

Details: this class solely provides as default second argument to TransformSearchSpace a shift in search space. shift=lambda x: x would provide "no shift", None expands to cma.ConstRandnShift().

Overrides: object.__init__