Module cma :: Class _BoxConstraintsTransformationTemplate
[hide private]
[frames] | no frames]

Class _BoxConstraintsTransformationTemplate

source code

                      object --+    
                               |    
BoxConstraintsTransformationBase --+
                                   |
                                  _BoxConstraintsTransformationTemplate

Implements a transformation into boundaries and is used for boundary handling:

tf = BoxConstraintsTransformationAnyDerivedClass([[1, 4]])
x = [3, 2, 4.4]
y = tf(x)  # "repaired" solution
print(tf([2.5]))  # middle value is never changed
[2.5]

copy/paste this template to implement a new boundary handling transformation


See Also: BoundaryHandler

Instance Methods [hide private]
 
__init__(self, bounds)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
initialize(self)
initialize in base class
source code
 
_transform_i(self, x, i) source code
 
_inverse_i(self, y, i) source code

Inherited from BoxConstraintsTransformationBase: __call__, bounds_i, inverse, shift_or_mirror_into_invertible_domain, transform

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

Class Variables [hide private]
  __doc__ = BoxConstraintsTransformationBase.__doc__+ __doc__
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bounds)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

initialize(self)

source code 
initialize in base class
Overrides: BoxConstraintsTransformationBase.initialize
(inherited documentation)

_transform_i(self, x, i)

source code 
Overrides: BoxConstraintsTransformationBase._transform_i

_inverse_i(self, y, i)

source code 
Overrides: BoxConstraintsTransformationBase._inverse_i