mutationShuffleIndexes

fun <T> mutationShuffleIndexes(value: Array<T>, chance: Double, random: Random)
fun mutationShuffleIndexes(value: BooleanArray, chance: Double, random: Random)
fun mutationShuffleIndexes(value: ByteArray, chance: Double, random: Random)
fun mutationShuffleIndexes(value: CharArray, chance: Double, random: Random)
fun mutationShuffleIndexes(value: DoubleArray, chance: Double, random: Random)
fun mutationShuffleIndexes(value: FloatArray, chance: Double, random: Random)
fun mutationShuffleIndexes(value: IntArray, chance: Double, random: Random)
fun mutationShuffleIndexes(value: LongArray, chance: Double, random: Random)
fun <T> mutationShuffleIndexes(value: MutableList<T>, chance: Double, random: Random)
fun mutationShuffleIndexes(value: ShortArray, chance: Double, random: Random)

Executes a shuffle the attributes of the input chromosome. Usually this mutation is applied on vector of indices.

Example:

Before mutation: 0, 1, 2, 3, 4
After mutation: 1, 4, 0, 3, 2 // genes change only position

Parameters

value

chromosome to be mutated

chance

the probability of each attribute to be moved.