mutation

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 3 Imported by: 3

Documentation

Overview

Package mutation provides an interface for a mutation method and some implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultGaussianMethod added in v1.1.2

func DefaultGaussianMethod(numPoints int) gaussianMethod

DefaultGaussianMethod returns a gaussianMethod which is optimal for almost all cases.

func NewGaussianMethod

func NewGaussianMethod(rate float64, amount float64) gaussianMethod

NewGaussianMethod returns a gaussianMethod with specified a mutation rate and amount.

func NewRandomMethod

func NewRandomMethod(rate float64, amount float64) randomMethod

NewRandomMethod returns a randomMethod with specified a mutation rate and amount.

Types

type Method

type Method interface {
	// Mutate mutates a normgeom.NormPointGroup.
	// A function, mutated, is called when a point is mutated.
	Mutate(points normgeom.NormPointGroup, mutated func(mutation Mutation))
}

A Method is used to apply mutations on a point group.

type Mutation

type Mutation struct {
	Old, New normgeom.NormPoint // The point before and after being mutated.
	Index    int                // The index of the point mutated.
}

Mutation stores data related to a mutation.

Jump to

Keyboard shortcuts

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