diff --git a/config.yaml b/config.yaml index 58fe996..4b99ba1 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,5 @@ last_step: 100 +init_amount: 10 steps: - step: 10 amount: 1 diff --git a/main.go b/main.go index fafc40a..71471d7 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,7 @@ var coherenceFactor = 8 type configuration struct { Steps []steps `yaml:"steps"` LastStep int `yaml:"last_step"` + InitAmount int `yaml:"init_amount"` } type steps struct { Step int `yaml:"step"` @@ -73,6 +74,7 @@ func main() { err = yaml.Unmarshal(conf, &config) steps := config.Steps loops = config.LastStep + populationSize = config.InitAmount defer func() { if err := fo.Close(); err != nil { panic(err) @@ -81,7 +83,10 @@ func main() { clearScreen() hideCursor() var goids []*Goid - + for i := 0; i < populationSize; i++ { + g := createRandomGoid() + goids = append(goids, &g) + } current_stage := 0 for i := 0; i < loops; i++ { goids, populationSize = fixGoids(goids, populationSize, steps[current_stage].Amount)