diff --git a/src/blop/agent.py b/src/blop/agent.py index 4e95546..df04907 100644 --- a/src/blop/agent.py +++ b/src/blop/agent.py @@ -192,6 +192,8 @@ def sample(self, n: int = DEFAULT_MAX_SAMPLES, normalize: bool = False, method: How many points to sample. method : str How to sample the points. Must be one of 'quasi-random', 'random', or 'grid'. + normalize: bool + If True, sample the unit hypercube. If False, sample the parameter space of the agent. """ active_dofs = self.dofs(active=True) diff --git a/src/blop/objectives.py b/src/blop/objectives.py index 1f9f10d..5479767 100644 --- a/src/blop/objectives.py +++ b/src/blop/objectives.py @@ -334,10 +334,10 @@ def _test_obj(obj, active=None, fitness=None, constraint=None): if obj.active != active: return False if fitness is not None: - if obj.target is None: + if fitness != (obj.target is not None): return False if constraint is not None: - if obj.constraint is None: + if constraint != (obj.constraint is not None): return False return True