go(algo): use Dimensions slice from the bench pkg
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-07-17 11:57:40 +02:00
parent 7742642e14
commit 6db4b60875
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 3 additions and 3 deletions

@ -30,7 +30,7 @@ func DoRandomSearch(wg *sync.WaitGroup, m *sync.Mutex) {
for i := range algoStats { for i := range algoStats {
// ng y'all. // ng y'all.
go RandomSearchNG(10000, 30, []int{5, 10, 20}, bench.FuncNames[i], ch) go RandomSearchNG(10000, 30, bench.Dimensions, bench.FuncNames[i], ch)
} }
// get results. // get results.
@ -77,7 +77,7 @@ func DoStochasticHillClimbing(wg *sync.WaitGroup, m *sync.Mutex) {
ch := make(chan []stats.Stats, funcCount) ch := make(chan []stats.Stats, funcCount)
for i := range algoStats { for i := range algoStats {
go HillClimb(10000, 30, []int{5, 10, 20}, bench.FuncNames[i], ch) go HillClimb(10000, 30, bench.Dimensions, bench.FuncNames[i], ch)
} }
// get results. // get results.

@ -21,7 +21,7 @@ const (
var ( var (
// Dimensions to compute for (spatial complexity..?). // Dimensions to compute for (spatial complexity..?).
Dimensions = []uint{5, 10, 20} Dimensions = []int{5, 10, 20}
// SchwefelParams is a struct holding the min, max allowed value of inputs // SchwefelParams is a struct holding the min, max allowed value of inputs
// passed to the Schwefel function. // passed to the Schwefel function.