12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- package main
- import (
- genetic "./genetic"
- mutagen "./genetic/mutagen"
- remotecontrol "./remotecontrol"
- snakesimulator "./snakesimulator"
- )
- func main() {
- rc := &remotecontrol.RemoteControl{}
- go rc.Run()
- s := snakesimulator.NewSnakeSimulator()
- s.StartServer()
- p := genetic.NewPopulation(s, mutagen.NewDummyMutagen(50), genetic.PopulationConfig{PopulationSize: 500, SelectionSize: 0.05, CrossbreedPart: 0.2}, []int{24, 20, 20, 4})
- for _, net := range p.Networks {
- net.SetStateWatcher(rc)
- }
- p.NaturalSelection(200)
- s.Run()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
|