go: add flag -generate
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-07-18 02:33:17 +02:00
parent 1c7fd068c5
commit ed2aece330
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

24
main.go

@ -18,24 +18,28 @@ func main() {
log.Println("starting math-optim version", "'"+version+"'")
doPrint := flag.Bool("printreport", true, "print report.tex to console")
generate := flag.Bool("generate", true, "run algos and generate plot pics/statistical tables (anew)")
flag.Parse()
// atm we're only doing Random search and SHC
algoCount := 2
if *generate {
// atm we're only doing Random search and SHC
algoCount := 2
var wg sync.WaitGroup
var wg sync.WaitGroup
wg.Add(algoCount)
wg.Add(algoCount)
var m sync.Mutex
var m sync.Mutex
go algo.DoRandomSearch(&wg, &m)
go algo.DoStochasticHillClimbing(&wg, &m)
go algo.DoRandomSearch(&wg, &m)
go algo.DoStochasticHillClimbing(&wg, &m)
wg.Wait()
wg.Wait()
report.SaveTexAllPics()
report.SaveTexAllTables()
}
report.SaveTexAllPics()
report.SaveTexAllTables()
report.SaveAndPrint(*doPrint)
log.Println("looks like we're done")