How do I evaluate my objective function in parallel while using gamultiobj in matlab for multiobjective optimization?

1 次查看(过去 30 天)
I am using gamultiobj to do multiobjective optimization (where there are two objectives). The objective function takes some time to evaluate. So, I want to compute my fitness function (or objective function) in parallel. There population size is 100 in my problem. So, the fitness function has to work for 100 different populations which takes a lot of time. How can I compute the fitness function in parallel way? Any tips and suggestions would be appreciated.
Thank you.

回答(1 个)

Milan Bansal
Milan Bansal 2023-10-6
Hi Rajan Bhandari,
It is my understanding that you want to compute the objective functions in parallel while using "gamultiobj" solver for Multiobjective Optimization.
Please try using Parallel Computing Toolbox for this task. Refer to the following code for using Parallel Computing Toolbox for "gamultiobj" solver.
pool = parpool() % create parallel pool
options = optimoptions('gamultiobj', 'UseParallel', 'always'); % set options
[x, fval] = gamultiobj(fitnessFunction, numVariables, A, b, Aeq, beq, lb, ub, options);
Please note that for Multiobjective Optimization, solver optimizes several objective functions simultaneously which might require synchronization and communication between the workers leading to slower optimization when using Parallel Computing Toolbox. In such a case set the "UseParallel" option to "never" as shown below.
options = optimoptions('gamultiobj', 'UseParallel', 'never'); % set options
Please refer to the following documentation link to learn more about Multiobjective Optimization.
Please refer to the following documentation link to learn more about Parallel Computing Toolbox.
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Multiobjective Optimization 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by