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

Class BoxConstraintsTransformationBase

source code

object --+
         |
        BoxConstraintsTransformationBase
Known Subclasses:

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]

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
 
_lowerupperval(self, a, b, c) source code
 
bounds_i(self, i)
return [ith_lower_bound, ith_upper_bound]
source code
 
__call__(self, solution_in_genotype) source code
 
transform(self, solution_in_genotype) source code
 
inverse(self, solution_in_phenotype, copy_if_changed=True, copy_always=True) source code
 
_index(self, i) source code
 
_transform_i(self, x, i) source code
 
_inverse_i(self, y, i) source code
 
shift_or_mirror_into_invertible_domain(self, solution_genotype)
return the reference solution that has the same box_constraints_transformation(solution) value, i.e. tf.shift_or_mirror_into_invertible_domain(x) = tf.inverse(tf.transform(x)). This is an idempotent mapping (leading to the same result independent how often it is repeatedly applied).
source code

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, bounds)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)