From c9e8a341592f7ff589d8edf41b14972c9ff8340a Mon Sep 17 00:00:00 2001 From: Johanni Brea Date: Wed, 31 Mar 2021 17:48:45 +0200 Subject: [PATCH] fix --- Project.toml | 2 +- src/CMAEvolutionStrategy.jl | 7 ++++++- src/print.jl | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 5014f48..880864b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CMAEvolutionStrategy" uuid = "8d3b24bd-414e-49e0-94fb-163cc3a3e411" authors = ["Johanni Brea "] -version = "0.2.0" +version = "0.2.1" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/CMAEvolutionStrategy.jl b/src/CMAEvolutionStrategy.jl index f9f69cb..ed623b1 100644 --- a/src/CMAEvolutionStrategy.jl +++ b/src/CMAEvolutionStrategy.jl @@ -39,7 +39,12 @@ function run!(o, f) update!(o.p, y, perm) log!(o, y, fvals, perm) terminate!(o) && break - o.logger.verbosity > 0 && (o.stop.it < 4 || o.stop.it % 100 == 0 || time() - o.logger.times[end] > 2) && print_state(o) + if o.logger.verbosity > 0 && + (o.stop.it < 4 || + o.stop.it % 100 == 0 || + time() - o.logger.times[end] > 2) + print_state(o) + end end if o.logger.verbosity > 0 print_state(o) diff --git a/src/print.jl b/src/print.jl index e205aef..6aed0c8 100644 --- a/src/print.jl +++ b/src/print.jl @@ -6,7 +6,7 @@ function print_state(o) push!(l.times, time()) if o.stop.it == 1 print_header(o) - @printf "%6.s %8.s %14.s %9.s %10.s %9.s\n" "iter" "fevals" "function value" "sigma" "axis ratio" "time[s]" + @printf "%6s %8s %14s %9s %10s %9s\n" "iter" "fevals" "function value" "sigma" "axis ratio" "time[s]" end @printf "%6.d %8.d %.8e %.2e %10.3e %9.3f\n" o.stop.it o.stop.it * o.p.λ + noisefevals(o.p.noise_handling) l.fmedian[end] sigma(o.p) maximum(o.p.cov.C.sqrtvalues)/minimum(o.p.cov.C.sqrtvalues) l.times[end] - o.stop.t0 end