shakeBy

inline suspend fun <V, F, ES : EvolveScope<V, F>> ES.shakeBy(from: Int, to: Int, evaluateNew: Boolean = true, parallelismLimit: Int = parallelismConfig.workersCount, noinline fitnessFunction: (V) -> F = this.fitnessFunction, predicate: ES.() -> Boolean)

Shake population with Population.reset function if predicate is true.

Parameters

from

index from shaking start (inclusive)

to

index to shaking end (exclusive)

evaluateNew

if true (default) evaluates new chromosome after shaking

parallelismLimit

limit of parallel workers (for evaluation)

fitnessFunction

fitnessFunction for evaluation


inline suspend fun <V, F, ES : EvolveScope<V, F>> ES.shakeBy(percent: Double, evaluateNew: Boolean = true, parallelismLimit: Int = parallelismConfig.workersCount, noinline fitnessFunction: (V) -> F = this.fitnessFunction, predicate: ES.() -> Boolean)

Shake percent*100% population with Population.reset function if predicate is true.

Parameters

percent

in range 0.0..1.0

evaluateNew

if true (default) evaluates new chromosome after shaking

parallelismLimit

limit of parallel workers (for evaluation)

fitnessFunction

fitnessFunction for evaluation