operators

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitFlip

func BitFlip[S ~[]bool]() engine.MutationFunc[S]

BitFlip creates a MutationFunc for boolean slices (e.g. BitString). The rate is the probability of flipping each individual bit.

func Gaussian

func Gaussian[S ~[]float64](standardDeviation float64) engine.MutationFunc[S]

Gaussian creates a MutationFunc for float64 slices (e.g. FloatVector). The rate is the probability of mutating each individual gene. The standardDeviation controls the magnitude of the Gaussian noise added.

func OrderCrossover

func OrderCrossover[S ~[]E, E comparable]() engine.CrossoverFunc[S]

OrderCrossover is specifically for permutations (represented as slices of comparable elements). It preserves permutations without duplicates.

func SinglePointCrossover

func SinglePointCrossover[S ~[]E, E any]() engine.CrossoverFunc[S]

SinglePointCrossover creates a CrossoverFunc for any slice-based genome.

func Swap

func Swap[S ~[]E, E any]() engine.MutationFunc[S]

Swap creates a MutationFunc for any slice-based genome. The rate is the probability that a swap occurs. If it occurs, two random positions are swapped.

func UniformCrossover

func UniformCrossover[S ~[]E, E any]() engine.CrossoverFunc[S]

UniformCrossover creates a CrossoverFunc for any slice-based genome.

Types

This section is empty.

Jump to

Keyboard shortcuts

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