diff --git a/algo/algo.go b/algo/algo.go index 79415ea..9f0e7ae 100644 --- a/algo/algo.go +++ b/algo/algo.go @@ -54,11 +54,13 @@ func DoRandomSearch(wg *sync.WaitGroup, m *sync.Mutex) { pLs = append(pLs, pL) } + algoName := "Random Search" + // protect access to shared data. m.Lock() - report.SavePicsToFile(pLs, "Random Search") + report.SavePicsToFile(pLs, algoName) - stats.SaveTable("Random Search", algoStats) + stats.SaveTable(algoName, algoStats) m.Unlock() } @@ -101,11 +103,13 @@ func DoStochasticHillClimbing(wg *sync.WaitGroup, m *sync.Mutex) { pLs = append(pLs, pL) } + algoName := "Stochastic Hill Climbing" + // protect access to shared data. m.Lock() - report.SavePicsToFile(pLs, "Stochastic Hill Climbing") + report.SavePicsToFile(pLs, algoName) - stats.SaveTable("Stochastic Hill CLimbing", algoStats) + stats.SaveTable(algoName, algoStats) m.Unlock() }