an utility function to easily generate the commonly used until parameter, as used by fuzzycoco_fit_df_hybrid()

stop_engine_on_first_of(
  max_generations = NULL,
  max_fitness = NULL,
  other_func = NULL
)

Arguments

max_generations

The maximum number of iterations of the algorithm. Each iteration produces a new generation of the rules and membership functions populations.

max_fitness

a stop condition: the iterations stop as soon as a generated fuzzy system fitness reaches that threshold.

other_func

if not NULL, a function engine –>logical that should return TRUE to stop the evolution (cf stop_engine_if_stalling())

Value

a function engine –> logical that stops (i.e/ returns TRUE) when the number of generations or the fitness are reached, or when the other_func if provided returns TRUE

Examples

until <- stop_engine_on_first_of(max_generations = 100)
until <- stop_engine_on_first_of(max_generations = 100, max_fitness = 0.8)
until <- stop_engine_on_first_of(max_fitness = 0.9, other_func = stop_engine_if_stalling(5))