An implementation of genetic algorithm in Golang
run in Bash(Linux/macOS)/CMD(Windows). It would print optimized value in each generation and generate a GIF(GA.gif) in the same folder to visualized the evolve process.
You can get pre-build binary release at GoGA/releases, which contains various packages for different targets.
| Param | Type | Default Value | Description |
|---|---|---|---|
| min | Float64 | -5.0 | minimum x value |
| max | Float64 | 5.0 | maximum x value |
| g | Int | 30 | maximum generation |
| s | Int | 100 | population size |
| m | Float64 | 0.1 | MutationProbability |
| c | Float64 | 0.6 | CrossoverProbability |
| p | Float64 | 0.01 | Precision |
| f | String | r | function to select individuals (r for Roulette, t for Tournament) |
You can get this usage sheet in command line using '-h'
Go 1.19.3
go build main.go./main <CLI Args>



