crossover

package
v0.0.0-...-7e3e582 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 1 Imported by: 5

Documentation

Overview

Package crossover provides methods to combine two solution candidates to find another solution. It complements the hego package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arithmetic

func Arithmetic(a, b []float64, uRange [2]float64) []float64

Arithmetic chooses u in range and performs c = u * a + (1-u) * b for every element in a and b

func OnePointBool

func OnePointBool(a, b []bool) []bool

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

func OnePointInt(a, b []int) []int

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

func OnePointPerm(a, b []int) []int

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

func TwoPointBool(a, b []bool) []bool

TwoPointBool is analogue to OnePointBool with two intersection points

func TwoPointInt

func TwoPointInt(a, b []int) []int

TwoPointInt is analogue to OnePointInt with two intersection points

func TwoPointPerm

func TwoPointPerm(a, b []int) []int

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

func UniformBool(a, b []bool) []bool

UniformBool uniformly selects attributes from a or b panics if a and b have different lengths

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL