diff --git a/mc_work/dorun.go b/mc_work/dorun.go index 317e7a4d5394f926538c1a6c555baab0995ab104..2982878c8f5b7df98ded913e59f73be0116e8950 100644 --- a/mc_work/dorun.go +++ b/mc_work/dorun.go @@ -135,8 +135,9 @@ func setupRun(mcPrm *McPrm, cprm *cprm) error { return nil } -// newx will move just one dimension at a time. Moving all dimensions at once -// required teeny moves. +// newx provides a random step to give us new coordinates. +// An earlier version moved all dimensions at once, but required +// teeny moves. func newx(xold []float32, xT []float32, rand *rand.Rand, xDlta float64) { var iDim int if (len(xold)) > 1 { @@ -260,7 +261,7 @@ func DoRun(mcPrm *McPrm) (MCresult, error) { for n := 0; n < mcPrm.NStep; n++ { var accept bool - if mcPrm.AdaptStep { + if mcPrm.AdaptStep { // Are we trying adaptive steps ? nRunAcc-- if nRunAcc == 0 { // Do we want to try adjusting the step size ? xDlta = nRunAdj(mcPrm, n, runAcc, xDlta) @@ -303,7 +304,7 @@ func DoRun(mcPrm *McPrm) (MCresult, error) { defer fmt.Println("n accepted:", nAcc, "of", mcPrm.NStep) if bestX != nil { - defer fmt.Printf("Best function value: %.2f at %.2v\n", bestfval, bestX) + defer fmt.Printf("Best function value: %.2f at %.2v at step %d\n", bestfval, bestX, bestN) } else { defer fmt.Println("bestX was never initialised") } diff --git a/ui/ui_run.go b/ui/ui_run.go index 8a9a122a3eca00f5149e7d4dd6e78d093aa1f8f6..823e03eac3ccebedecec619858275051fbb8e82a 100644 --- a/ui/ui_run.go +++ b/ui/ui_run.go @@ -22,7 +22,7 @@ type genParams struct { chn chan workstatus // To tell the output tab current status } -// We have a channel that sends the status to the output tab. +// We have a channel used to tell the output tab that there are new results. type status uint8 const ( @@ -57,6 +57,3 @@ func UiDoRun(mcPrm *mcwork.McPrm) error { win.ShowAndRun() return nil } - -func nothing(...interface{}) {} -func breaker(...interface{}) {}