Skip to content

Commit 8b9a9a2

Browse files
committed
changed K constant to be in line with comment
1 parent 51b7743 commit 8b9a9a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/constrained_problem_with_equality_and_inequalities.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ residual(x::Vector{Float64}) = l2(subpenalties(x))
2424

2525
# To use a static penalty function we need to select a penalty constant K, which is typically large.
2626
# However, I tried for K from 10.0 and up to 1e4 and it seems better with a smaller K so let's use 10.0.
27-
K = 1e2
27+
K = 1e1
2828
penalized_fitness(x::Vector{Float64}) = origfitness(x) + K * residual(x)
2929

3030
# Let's run the optimizer.
@@ -40,4 +40,4 @@ best = best_candidate(res)
4040
@assert isapprox(best[4], 1.37940829, atol = 1e-5)
4141

4242
# This seems better than what is achieved on the web page above but we also
43-
# run many more function evaluations...
43+
# run a few more function evaluations so...

0 commit comments

Comments
 (0)