def learn(self, maxSteps=None):
        """ Toplevel function, can be called iteratively.

        :return: best evaluable found in the last generation. """
        if maxSteps != None:
            maxSteps += self.steps
        while True:
            if maxSteps != None and self.steps + self._stepsPerGeneration() > maxSteps:
                break
            if self.maxEvaluations != None and self.steps + self._stepsPerGeneration() > self.maxEvaluations:
                break
            if self.maxGenerations != None and self.generation >= self.maxGenerations:
                break
            self._oneGeneration()
        return self.hallOfFame[-1]
dataset/ETHPy150Open pybrain/pybrain/pybrain/optimization/populationbased/coevolution/coevolution.py/Coevolution.learn/original