class documentation
class IntegerMixedFunction(ComposedFunction):
Constructor: IntegerMixedFunction(function, integer_variable_indices, operator, copy_arg)
DEPRECATED compose fitness function with some integer variables using np.floor by default.
>>> import cma >>> f = cma.s.ft.IntegerMixedFunction(cma.ff.elli, [0, 3, 6]) >>> assert f([0.2, 2]) == f([0.4, 2]) != f([1.2, 2])
It is advisable to set minstd of integer variables to
1 / (2 * len(integer_variable_indices) + 1), in which case in
an independent model at least 33% (1 integer variable) -> 39% (many
integer variables) of the solutions should have an integer mutation
on average. Option integer_variables of cma.CMAOptions
implements this simple measure.
| Method | __init__ |
apply operator(x[i]) for i in integer_variable_indices before to call function(x) |
| Instance Variable | copy |
Undocumented |
| Instance Variable | integer |
Undocumented |
| Instance Variable | operator |
Undocumented |
| Method | _flatten |
Undocumented |
Inherited from ComposedFunction:
| Method | __call__ |
Undocumented |
| Method | inverse |
evaluate the composition of inverses on x. |
| Instance Variable | list |
Undocumented |
Inherited from Function (via ComposedFunction):
| Method | initialize |
initialization of Function |
| Instance Variable | evaluations |
Undocumented |
| Instance Variable | ftarget |
Undocumented |
| Instance Variable | target |
Undocumented |
| Property | function |
attributes which are searched for to be called if no function was given to __init__. |
| Class Variable | _function |
Undocumented |
| Instance Variable | __callable |
Undocumented |
| Instance Variable | __initialized |
Undocumented |