def should_stop(self) -> bool:
        """Check if the searcher should stop at the current trial."""
        return (
            (len(self._search_space) == 0)
            or (self.num_samples_suggested >= len(self._search_space))
            or ((self.max_samples > 0) and (self.num_samples_suggested >= self.max_samples))
        )
Check if the searcher should stop at the current trial.
olive/search/samplers/search_sampler.py