Learn R Programming

Rfuzzycoco (version 0.1.0)

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

Description

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

Usage

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

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

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())

Examples

Run this code
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))

Run the code above in your browser using DataLab