go(algo): do HillClimb
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-07-08 21:40:04 +02:00
parent c0ab6f3fff
commit aaa6e6f298
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 19 additions and 0 deletions

@ -45,6 +45,21 @@ func DoStochasticHillClimbing(wg *sync.WaitGroup) {
defer wg.Done()
printSHC("starting...")
// funcCount is the number of bench functions available.
funcCount := len(bench.Functions)
// stats for the current algo (StochasticHillClimber).
algoStats := make([][]stats.Stats, funcCount)
for i := range algoStats {
algoStats[i] = HillClimb(10000, 30, []int{5, 10, 20}, bench.FuncNames[i])
}
for _, algoStat := range algoStats {
plotAllDims(algoStat, "plot", ".svg")
}
stats.PrintStatisticTable(algoStats)
}
func newValues() *Values {

@ -29,6 +29,10 @@ func TestDoSHCExec(t *testing.T) {
go DoStochasticHillClimbing(&wg)
wg.Wait()
if err := os.RemoveAll(picPath); err != nil {
t.Error(err)
}
}
func TestNewValues(t *testing.T) {