12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package main
- import (
- genetic "git.semlanik.org/semlanik/NeuralNetwork/genetic"
- mutagens "git.semlanik.org/semlanik/NeuralNetwork/genetic/mutagens"
- snakesimulator "git.semlanik.org/semlanik/SnakeSimulator/snakesimulator"
- )
- func main() {
- s := snakesimulator.NewSnakeSimulator(400)
- s.StartServer()
- p := genetic.NewPopulation(s, mutagens.NewDummyMutagen(1.0, 1), genetic.PopulationConfig{PopulationSize: 2000, SelectionSize: 0.01, CrossbreedPart: 0.5}, []int{24, 18, 18, 4})
- p.NaturalSelection(5000)
- s.PlayBestNetwork(p.GetBestNetwork())
- }
|