diff --git a/algo/randomSearch.go b/algo/randomSearch.go index eca2e78..734d429 100644 --- a/algo/randomSearch.go +++ b/algo/randomSearch.go @@ -7,6 +7,7 @@ import ( "fmt" "log" "os" + "sort" "time" "git.dotya.ml/wanderer/math-optim/bench" @@ -184,6 +185,8 @@ func RandomSearchNG(maxFES, benchMinIters int, theD []int, benchFunc string, ch rsMeans.Means = append(rsMeans.Means, *dimXMean) } + sort.Sort(rsMeans) + // export AlgoMeans. mu.Lock() meanStats.AlgoMeans = append(meanStats.AlgoMeans, *rsMeans) diff --git a/algo/stochasticHillClimbing.go b/algo/stochasticHillClimbing.go index 8b82802..2b23e80 100644 --- a/algo/stochasticHillClimbing.go +++ b/algo/stochasticHillClimbing.go @@ -8,6 +8,7 @@ import ( "log" "math" "os" + "sort" "time" "git.dotya.ml/wanderer/math-optim/bench" @@ -301,6 +302,8 @@ func HillClimb(maxFES, benchMinIters int, theD []int, benchFunc string, ch chan shcMeans.Means = append(shcMeans.Means, *dimXMean) } + sort.Sort(shcMeans) + // export AlgoMeans. mu.Lock() meanStats.AlgoMeans = append(meanStats.AlgoMeans, *shcMeans)