Documentation
¶
Index ¶
- func BitFlip[S ~[]bool]() engine.MutationFunc[S]
- func Gaussian[S ~[]float64](standardDeviation float64) engine.MutationFunc[S]
- func OrderCrossover[S ~[]E, E comparable]() engine.CrossoverFunc[S]
- func SinglePointCrossover[S ~[]E, E any]() engine.CrossoverFunc[S]
- func Swap[S ~[]E, E any]() engine.MutationFunc[S]
- func UniformCrossover[S ~[]E, E any]() engine.CrossoverFunc[S]
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.