From a7205c0366f208fa5808176b8c0ad70de542c9ef Mon Sep 17 00:00:00 2001 From: c-bata Date: Wed, 19 Feb 2020 01:46:19 +0900 Subject: [PATCH] Fix lint error --- examples/quadratic_function.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/quadratic_function.py b/examples/quadratic_function.py index 144084e..012d273 100644 --- a/examples/quadratic_function.py +++ b/examples/quadratic_function.py @@ -8,6 +8,8 @@ def quadratic(x1, x2): def main(): cma_es = CMA(mean=np.zeros(2), sigma=1.3) + print(" g f(x1,x2) x1 x2 ") + print("=== ========== ====== ======") for generation in range(50): solutions = [] @@ -15,9 +17,11 @@ def main(): x = cma_es.ask() value = quadratic(x[0], x[1]) solutions.append((x, value)) - print("#{g} {value} (x1={x1}, x2 = {x2})".format( + + msg = "{g:3d} {value:10.5f} {x1:6.2f} {x2:6.2f}".format( g=generation, value=value, x1=x[0], x2=x[1], - )) + ) + print(msg) cma_es.tell(solutions)