|
@@ -3,15 +3,21 @@ 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), 40, []int{16, 12, 12, 4})
|
|
|
+ p := genetic.NewPopulation(s, mutagen.NewDummyMutagen(50), 400, []int{16, 18, 18, 4})
|
|
|
+ for _, net := range p.Networks {
|
|
|
+ net.SetStateWatcher(rc)
|
|
|
+ }
|
|
|
p.NaturalSelection(200)
|
|
|
- // s.Run()
|
|
|
+ s.Run()
|
|
|
|
|
|
// sizes := []int{13, 8, 12, 3}
|
|
|
// nn, _ := neuralnetwork.NewNeuralNetwork(sizes, neuralnetwork.NewRPropInitializer(neuralnetwork.RPropConfig{
|
|
@@ -21,7 +27,6 @@ func main() {
|
|
|
// DeltaMin: 0.000001,
|
|
|
// }))
|
|
|
|
|
|
- // rc := &remotecontrol.RemoteControl{}
|
|
|
// nn.SetStateWatcher(rc)
|
|
|
// rc.Run()
|
|
|
|