Run the optimization
A NOMAD optimization process can be run by using the solve() method described below.
NOMAD.solve — Method
solve(p::NomadProblem, x0::Vector{Float64})-> Run NOMAD with settings defined by NomadProblem p from starting point x0.
-> Display stats from NOMAD in the REPL.
-> Return a NamedTuple that contains info about the run, specifically:
status::Int:
| Value | Meaning |
|---|---|
1 | Objective target reached OR Mads converged |
| (mesh criterion) to a feasible point (true problem). | |
0 | At least one feasible point obtained and evaluation |
| budget spent or max iteration (user option) reached. | |
-1 | Mads mesh converged but no feasible point obtained |
| (only infeasible) for the true problem. | |
-2 | No feasible point obtained (only infeasible) and |
| evaluation budget (single bb or block of bb) spent | |
| or max iteration (user option) reached. | |
-3 | Initial point failed to evaluate. |
-4 | Time limit reached (user option). |
-5 | CTRL-C or user stopped (callback function). |
-6 | Stop on feasible point (user option). |
-7 | Wrong parameters. |
-8 | Something has gone wrong with the optimization. |
All the other fields are populated if status ∉ [-3, -7, -8].
feasible::Bool:
Indicates if the set of solutions returned by the algorithm is feasible.
Arguments:
p::NomadProblem
The problem to solve.
x0::Vector{Float64}
The starting point. Must satisfy lb <= x0 <= ub where lb and ub are respectively the lower and upper bounds of the NomadProblem p. When A and b are defined, it must satisfy A * x0 = b.
Example:
using NOMAD
function eval_fct(x)
f = x[1]^2 + x[2]^2
c = 1 - x[1]
success = true
count_eval = true
bb_outputs = [f,c]
return (success, count_eval, bb_outputs)
end
# creation of a blackbox of dimensions 2*2 with one objective ("OBJ")
# and a constraint treated with the extreme barrier approach ("EB")
p = NomadProblem(2, 2, ["OBJ", "EB"], eval_fct)
# solve problem starting from the point [5.0;5.0]
stats = solve(p, [5.0;5.0])