onSteadyGenerations

inline fun <V, F, ES : EvolveScope<V, F>> ES.onSteadyGenerations(targetIterationCount: Int, storeNamePrevious: String = STEADY_GENERATIONS, storeNameIteration: String = STEADY_GENERATIONS_CURRENT_ITERATION, onSteadyGenerations: ES.(target: F) -> Unit): Boolean

Check for steady generation with Chromosome.fitness.

Return

true if best fitness of Chromosome not changed after last targetIterationCount iterations.

Parameters

targetIterationCount

the maximum number of iterations during which the best fitness may not change

onSteadyGenerations

action to invoke when it returns true


inline fun <T : Comparable<T>, V, F, ES : EvolveScope<V, F>> ES.onSteadyGenerations(target: T, targetIterationCount: Int, storeNamePrevious: String = STEADY_GENERATIONS, storeNameIteration: String = STEADY_GENERATIONS_CURRENT_ITERATION, onSteadyGenerations: ES.(target: T) -> Unit): Boolean

Check for steady generation with target.

Return

true if best fitness of Chromosome not changed after last targetIterationCount iterations.

Parameters

target

some comparable value for comparison

targetIterationCount

the maximum number of iterations during which the best fitness may not change

onSteadyGenerations

action to invoke when it returns true


inline fun <T, V, F, ES : EvolveScope<V, F>> ES.onSteadyGenerations(target: T, targetIterationCount: Int, storeNamePrevious: String = STEADY_GENERATIONS, storeNameIteration: String = STEADY_GENERATIONS_CURRENT_ITERATION, equalsPredicate: (current: T, previous: T) -> Boolean, onSteadyGenerations: ES.(target: T) -> Unit): Boolean

Check for steady generation with target.

Return

true if best fitness of Chromosome not changed after last targetIterationCount iterations.

Parameters

target

some comparable value for comparison

targetIterationCount

the maximum number of iterations during which the best fitness may not change

equalsPredicate

action for comparison target with previous value

onSteadyGenerations

action to invoke when it returns true