Skip to content

Commit 8b44d26

Browse files
committed
relax test tolerance
1 parent b135548 commit 8b44d26

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/rosenbrock.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,28 @@
5252
c = PenaltyConstraints(100.0, fill(0.0, 5N), Float64[], [1.0], [1.0], con_c!)
5353
result = Evolutionary.optimize(rosenbrock, c, (() -> rand(5N)), CMAES(mu = 40, lambda = 100))
5454
println("(5/5,100)-CMA-ES [penalty] => F: $(minimum(result)), C: $(Evolutionary.iterations(result))")
55-
@test Evolutionary.minimizer(result) |> sum 1.0 atol=1e-1
55+
@test Evolutionary.minimizer(result) |> sum 1.0 atol=0.1
5656

5757
c = PenaltyConstraints(100.0, fill(0.0, 2N), fill(0.5, 2N), [1.0], [1.0], con_c!)
5858
result = Evolutionary.optimize(rosenbrock, c, (() -> rand(2N)), CMAES(mu = 8, lambda = 100))
5959
println("(5/5,100)-CMA-ES [penalty] => F: $(minimum(result)), C: $(Evolutionary.iterations(result))")
60-
@test Evolutionary.minimizer(result) |> sum 1.0 atol=1e-1
60+
@test Evolutionary.minimizer(result) |> sum 1.0 atol=0.1
6161
@test all(0.0 <= x+0.01 && x-0.01 <= 0.5 for x in abs.(Evolutionary.minimizer(result)))
6262

6363
# Testing: GA
6464
m = GA(
6565
populationSize = 100,
6666
ɛ = 0.1,
6767
selection = rouletteinv,
68-
crossover = intermediate(0.25),
68+
crossover = IC(0.2),
6969
mutation = BGA(fill(0.5,N))
7070
)
7171
result = Evolutionary.optimize(rosenbrock, (() -> rand(N)), m)
7272
println("GA(p=100,x=0.8,μ=0.1,ɛ=0.1) => F: $(minimum(result)), C: $(Evolutionary.iterations(result))")
73-
test_result(result, N, 1e-1)
73+
test_result(result, N, 0.1)
7474
result = Evolutionary.optimize(rosenbrock, BoxConstraints(0.0, 0.5, N), (() -> rand(N)), m)
7575
println("GA(p=100,x=0.8,μ=0.1,ɛ=0.1)[box] => F: $(minimum(result)), C: $(Evolutionary.iterations(result))")
76-
@test Evolutionary.minimizer(result) [0.5, 0.25] atol=1e-1
76+
@test Evolutionary.minimizer(result) [0.5, 0.25] atol=0.1
7777

7878
# Testing: DE
7979
result = Evolutionary.optimize(rosenbrock, (() -> rand(N)), DE(populationSize = 100))

0 commit comments

Comments
 (0)