def METHOD_NAME(self, max_evals, timeout):
    if len(self._problem._hp_space._space) > 0:
        raise ValueError(
            "An hyperparameter space was defined for this problem but the current search is not compatible with joint hyperparameter and neural architecture search. Constant values should be defined for hyperparameters."
        )
    num_evals_done = 0
    # Filling available nodes at start
    batch = self._gen_random_batch(size=self._evaluator.num_workers)
    self._evaluator.submit(batch)
    # Main loop
    while max_evals < 0 or num_evals_done < max_evals:
        # Collecting finished evaluations
        new_results = self._evaluator.gather("BATCH", 1)
        num_received = len(new_results)
        if num_received > 0:
            self._population.extend(new_results)
            self._evaluator.dump_evals(
                saved_keys=self._saved_keys, log_dir=self._log_dir
            )
            num_evals_done += num_received
            if num_evals_done >= max_evals:
                break
            # If the population is big enough evolve the population
            if len(self._population) == self._population_size:
                children_batch = []
                # For each new parent/result we create a child from it
                for _ in range(num_received):
                    # select_sample
                    indexes = self._random_state.choice(
                        self._population_size, self._sample_size, replace=False
                    )
                    sample = [self._population[i] for i in indexes]
                    # select_parent
                    parent = self._select_parent(sample)
                    # copy_mutate_parent
                    child = self._copy_mutate_arch(parent)
                    # add child to batch
                    children_batch.append(child)
                # submit_childs
                self._evaluator.submit(children_batch)
            else:  # If the population is too small keep increasing it
                self._evaluator.submit(self._gen_random_batch(size=num_received))