powered by
an utility function to easily generate a stop function that stops when the convergence is stalling
stop_engine_if_stalling(nb_iterations)
a function: (engine) --> logical that stops (i.e/ returns TRUE) if the convergence is stalling
number of iterations of the stalling: stops if the fitness has not increased during that number of iterations.
until <- stop_engine_on_first_of(max_generations = 1000, other_func = stop_engine_if_stalling(5))
Run the code above in your browser using DataLab