diff --git a/nevergrad/parametrization/core.py b/nevergrad/parametrization/core.py index 28b3d9036..f2e52ae5c 100644 --- a/nevergrad/parametrization/core.py +++ b/nevergrad/parametrization/core.py @@ -300,7 +300,8 @@ def satisfies_constraints(self) -> bool: bool True iff the constraint is satisfied """ - if self._parameters is not None and not self.parameters.satisfies_constraints(): + inside = self._treecall("satisfies_constraints") + if not all(inside): return False if not self._constraint_checkers: return True @@ -595,18 +596,6 @@ def _internal_spawn_child(self: D) -> D: child._content = {k: v.spawn_child() for k, v in self._content.items()} return child - def _set_random_state(self, random_state: np.random.RandomState) -> None: - super()._set_random_state(random_state) - for param in self._content.values(): - if isinstance(param, Parameter): - param._set_random_state(random_state) - - def satisfies_constraints(self) -> bool: - compliant = super().satisfies_constraints() - return compliant and all( - param.satisfies_constraints() for param in self._content.values() if isinstance(param, Parameter) - ) - class Dict(Container): """Dictionary-valued parameter. This Parameter can contain other Parameters,