geneticAlgorithm

package
Version: v0.0.0-...-e3ff730 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crossover

func Crossover(p1 base.Tour, p2 base.Tour) base.Tour

Crossover : performs multi point cross over with 2 parents Assumption - parents have equal size

func CrossoverRate

func CrossoverRate() float32

func EvolvePopulation

func EvolvePopulation(pop base.Population) base.Population

EvolvePopulation : evolves population by :-

- Selecting 2 parents using tournament selection
- Perform crossover to obtain child
- Mutate child based on probability
- return new population

func Mutation

func Mutation(in *base.Tour)

Mutation : Performs swap mutation Chance of mutation for each City based on mutation rate

func TournamentSelection

func TournamentSelection(pop base.Population) base.Tour

TournamentSelection : select a group at random and pick the best parent

Types

This section is empty.

Jump to

Keyboard shortcuts

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