class documentation

compose fitness function with some integer variables using np.round by default.

>>> import numpy as np
>>> import cma
>>> f = cma.s.ft.IntegerMixedFunction2(cma.ff.elli, [0, 3, 5])
>>> assert f([-0.2, 2]) == f([0.4, 2]) != f([0.8, 2])
>>> f = cma.s.ft.IntegerMixedFunction2(cma.ff.elli, [0])
>>> assert f([-0.2, 2]) == f(np.array([0.4, 2])) != f(np.array([0.8, 2]))

Related: Option 'integer_variables' of cma.CMAOptions sets 'minstd' of integer variables, see cma.options_parameters.integer_std_lower_bound and rounds the better solutions, see cma.integer_centering.

Method __init__ apply operator(x[i]) for i in integer_variable_indices before to call function(x).
Instance Variable copy Undocumented
Instance Variable integer_variable_indices Undocumented
Instance Variable operator Undocumented
Method _flatten Undocumented
Method _flatten2 Undocumented

Inherited from ComposedFunction:

Method __call__ Undocumented
Method inverse evaluate the composition of inverses on x.
Instance Variable list_of_inverses Undocumented

Inherited from Function (via ComposedFunction):

Method initialize initialization of Function
Instance Variable evaluations Undocumented
Instance Variable ftarget Undocumented
Instance Variable target_hit_at Undocumented
Property function_names_to_evaluate_first_found attributes which are searched for to be called if no function was given to __init__.
Class Variable _function_names_to_evaluate_first_found Undocumented
Instance Variable __callable Undocumented
Instance Variable __initialized Undocumented
def __init__(self, function, integer_variable_indices, operator=np.round, copy=True):

apply operator(x[i]) for i in integer_variable_indices before to call function(x).

If copy, return a copy iff a value is changed.

copy =

Undocumented

integer_variable_indices =

Undocumented

operator =

Undocumented

def _flatten(self, x):

Undocumented

def _flatten2(self, x):

Undocumented