crossoverOrdered

fun crossoverOrdered(value1: IntArray, value2: IntArray, random: Random)

Executes an ordered crossover (OX) on the input chromosome values. The two value are modified in place. This crossover expects Chromosome.value as IntArray. Mixes indexes without conflicts, preserving parental relationships.

Parameters

value1

value of first child chromosome

value2

value of second child chromosome


fun crossoverOrdered(value1: IntArray, value2: IntArray, point1: Int, point2: Int, size: Int = minOf(value1.size, value2.size))

Executes an ordered crossover (OX) on the input chromosome values. The two value are modified in place. This crossover expects Chromosome.value as IntArray. Mixes indexes without conflicts, preserving parental relationships.

Parameters

value1

value of first child chromosome

value2

value of second child chromosome

point1

first point of crossover

point2

second point of crossover

size

count genes in swap (minimal value between sizes)