From 8f55d80731c202836284c6fc4cef4ea670ed82ec Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 19 Jan 2023 20:25:42 +0100 Subject: [PATCH] go(de): don't run evolve concurrently for dimens --- algo/de/jDE.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/algo/de/jDE.go b/algo/de/jDE.go index d0b52f4..a1c7253 100644 --- a/algo/de/jDE.go +++ b/algo/de/jDE.go @@ -6,7 +6,6 @@ import ( "log" "os" - "sync" "git.dotya.ml/wanderer/math-optim/bench" "git.dotya.ml/wanderer/math-optim/stats" @@ -131,28 +130,18 @@ func (j *JDE) Run() { jDELogger.Fatalln("jDE needs to be initialised before calling Run(), exiting...") } - // have a wait group. - var wg sync.WaitGroup - - // we're be spawning goroutines per dimension and that is the number of - // goroutines we need to wait for. - wg.Add(len(j.Dimensions)) - - // run Evolve for for all dimensions. + // run evolve for for all dimensions. for _, dim := range j.Dimensions { maxFES := bench.GetGAMaxFES(dim) - j.evolve(maxFES, &wg) + j.evolve(maxFES) } - - // wait for all. - wg.Wait() } // evolve evolves a population by running the jDE (self-adapting Differential // Evolution) algorithm on the passed population until termination conditions // are met. -func (j *JDE) evolve(maxFES int, wg *sync.WaitGroup) {} +func (j *JDE) evolve(maxFES int) {} // NewjDE returns a pointer to a new, uninitialised jDE instance. func NewjDE() *JDE {