Writing fitness function in multi objective GA
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hari
am 25 Mai 2022
Beantwortet: M Mirrashid
am 5 Jun. 2022
If I need to go for a multi objective optimisation in GA, how can I bring in the two objectives in a custom made fitness function. Can someone explain in the context of the travelling salesman problem described here : https://in.mathworks.com/help/gads/custom-data-type-optimization-using-ga.html
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 25 Mai 2022
mobj = @(x) [fun1(x); fun2(x) ]
7 Kommentare
Walter Roberson
am 27 Mai 2022
I am not getting a problem in my tests ?
fun1 = @(x) sin(pi*x(:,1)) + sinh(x(:,2));
fun2 = @(x) cos(pi*x(:,1)) + cosh(x(:,2));
mobj = @(x) [ fun1(x), fun2(x) ];
nvars = 2;
lb = [-pi -pi];
ub = [pi pi];
options1 = optimoptions(@gamultiobj, 'UseVectorized', false);
[Y1, fval1] = gamultiobj(mobj, nvars, [], [], [], [], lb, ub, [], options1);
options2 = optimoptions(@gamultiobj, 'UseVectorized', true);
[Y2, fval2] = gamultiobj(mobj, nvars, [], [], [], [], lb, ub, [], options1);
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Solver-Based Optimization Problem Setup finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!