go(algo): use var for algo name
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
602ee8206f
commit
efbc963875
12
algo/algo.go
12
algo/algo.go
@ -54,11 +54,13 @@ func DoRandomSearch(wg *sync.WaitGroup, m *sync.Mutex) {
|
|||||||
pLs = append(pLs, pL)
|
pLs = append(pLs, pL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
algoName := "Random Search"
|
||||||
|
|
||||||
// protect access to shared data.
|
// protect access to shared data.
|
||||||
m.Lock()
|
m.Lock()
|
||||||
report.SavePicsToFile(pLs, "Random Search")
|
report.SavePicsToFile(pLs, algoName)
|
||||||
|
|
||||||
stats.SaveTable("Random Search", algoStats)
|
stats.SaveTable(algoName, algoStats)
|
||||||
m.Unlock()
|
m.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,11 +103,13 @@ func DoStochasticHillClimbing(wg *sync.WaitGroup, m *sync.Mutex) {
|
|||||||
pLs = append(pLs, pL)
|
pLs = append(pLs, pL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
algoName := "Stochastic Hill Climbing"
|
||||||
|
|
||||||
// protect access to shared data.
|
// protect access to shared data.
|
||||||
m.Lock()
|
m.Lock()
|
||||||
report.SavePicsToFile(pLs, "Stochastic Hill Climbing")
|
report.SavePicsToFile(pLs, algoName)
|
||||||
|
|
||||||
stats.SaveTable("Stochastic Hill CLimbing", algoStats)
|
stats.SaveTable(algoName, algoStats)
|
||||||
m.Unlock()
|
m.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user