def __init__(self, no_init=False, **kwargs): Cost.__init__(self) self._weights = kwargs.pop('weights', []) if no_init: self._costs = kwargs.pop('costs', []) else: costs_params = kwargs.pop('costs', []) self._costs = [init_component(params) for params in costs_params] assert len(self._costs) > 0 assert isinstance(self._costs[0], Cost) assert len(self._costs) == len(self._weights)
def __init__(self, **kwargs): Cost.__init__(self) self._wu = kwargs.pop('wu') self._target = np.array(kwargs.pop('desired_state'), dtype=np.float64)