Documentation ¶
Overview ¶
Package crossover provides methods to combine two solution candidates to find another solution. It complements the hego package
Index ¶
- func Arithmetic(a, b []float64, uRange [2]float64) []float64
- func OnePointBool(a, b []bool) []bool
- func OnePointInt(a, b []int) []int
- func OnePointPerm(a, b []int) []int
- func TwoPointBool(a, b []bool) []bool
- func TwoPointInt(a, b []int) []int
- func TwoPointPerm(a, b []int) []int
- func UniformBool(a, b []bool) []bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Arithmetic ¶
Arithmetic chooses u in range and performs c = u * a + (1-u) * b for every element in a and b
func OnePointBool ¶
OnePointBool randomly chooses intersection point. Takes all elements from a, where the index is below the intersection point and b for the rest panics if length is different
func OnePointInt ¶
OnePointInt randomly chooses intersection point. Takes all elements from a, where the index is below the intersection point and b for the rest panics if length is different
func OnePointPerm ¶
OnePointPerm cuts a in two pieces and fills the gap with values from b while preserving order. 12345678 + 26371485 -> 1234**** + *6*7**85 -> 12346785
func TwoPointBool ¶
TwoPointBool is analogue to OnePointBool with two intersection points
func TwoPointInt ¶
TwoPointInt is analogue to OnePointInt with two intersection points
func TwoPointPerm ¶
TwoPointPerm takes a slice of a and fills the gaps with values from b while preserving order. 12345678 + 26371485 -> **3456** + 2**71*8* -> 27345618
func UniformBool ¶
UniformBool uniformly selects attributes from a or b panics if a and b have different lengths
Types ¶
This section is empty.