diff --git a/main.go b/main.go index 2b15041..d718dde 100644 --- a/main.go +++ b/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")