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.
0 个评论
回答(1 个)
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!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multiobjective Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!