Skip to content

Commit 2646d29

Browse files
MOO Docs updated blackboxoptim.md
Added documentation for MOO in BBO
1 parent 3271e64 commit 2646d29

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/src/optimization_packages/blackboxoptim.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,21 @@ prob = Optimization.OptimizationProblem(f, x0, p, lb = [-1.0, -1.0], ub = [1.0,
6767
sol = solve(prob, BBO_adaptive_de_rand_1_bin_radiuslimited(), maxiters = 100000,
6868
maxtime = 1000.0)
6969
```
70+
71+
## Multi-objective optimization
72+
The optimizer for Multi-Objective Optimization is `BBO_borg_moea()`. Your fitness function should return a tuple of the objective values and you should indicate the fitness scheme to be (typically) Pareto fitness and specify the number of objectives. Otherwise, the use is similar, here is an example:
73+
74+
```@example MOO-BBO
75+
using OptimizationBBO, Optimization, BlackBoxOptim
76+
using SciMLBase: MultiObjectiveOptimizationFunction
77+
u0 = [0.25, 0.25]
78+
opt = OptimizationBBO.BBO_borg_moea()
79+
function multi_obj_func_2(x, p)
80+
f1 = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2 # Rosenbrock function
81+
f2 = -20.0 * exp(-0.2 * sqrt(0.5 * (x[1]^2 + x[2]^2))) - exp(0.5 * (cos(2π * x[1]) + cos(2π * x[2]))) + exp(1) + 20.0 # Ackley function
82+
return (f1, f2)
83+
end
84+
mof = MultiObjectiveOptimizationFunction(multi_obj_func_2)
85+
prob = Optimization.OptimizationProblem(mof_2, u0; lb = [0.0, 0.0], ub = [2.0, 2.0])
86+
sol = solve(prob_2, opt, NumDimensions=2, FitnessScheme=ParetoFitnessScheme{2}(is_minimizing=true))
87+
```

0 commit comments

Comments
 (0)