go(algo): do HillClimb
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c0ab6f3fff
commit
aaa6e6f298
15
algo/algo.go
15
algo/algo.go
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user