class documentation

class StackFunction(Function):

Constructor: StackFunction(f1, f2, n1)

View In Hierarchy

a function that returns f1(x[:n1]) + f2(x[n1:]).

>>> import functools
>>> import numpy as np
>>> import cma
>>> def elli48(x):
...     return 1e-4 * functools.partial(cma.ff.elli, cond=1e8)(x)
>>> fcigtab = cma.fitness_transformations.StackFunction(
...     elli48, cma.ff.sphere, 2)
>>> x = [1, 2, 3, 4]
>>> assert np.isclose(fcigtab(x), cma.ff.cigtab(np.asarray(x)))
Method __init__ allows to define the fitness_function to be called, doesn't need to be ever called
Instance Variable f1 Undocumented
Instance Variable f2 Undocumented
Instance Variable n1 Undocumented
Method _eval Undocumented

Inherited from Function:

Method __call__ Undocumented
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, f1, f2, n1):

allows to define the fitness_function to be called, doesn't need to be ever called

f1 =

Undocumented

f2 =

Undocumented

n1 =

Undocumented

def _eval(self, x, *args, **kwargs):

Undocumented