%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % MIDACO solves Multi-Objective Mixed-Integer Non-Linear Problems: % % % Minimize F_1(X),... F_O(X) where X(1,...N-NI) is CONTINUOUS % and X(N-NI+1,...N) is DISCRETE % % subject to G_j(X) = 0 (j=1,...ME) equality constraints % G_j(X) >= 0 (j=ME+1,...M) inequality constraints % % and bounds XL <= X <= XU % % % The problem statement of this example is given below. You can use % this example as template to run your own problem. To do so: Replace % the objective functions 'F' (and in case the constraints 'G') given % here with your own problem and follow the below instruction steps. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function tspn08_neighborhoods key = '************************************************************'; problem.func = @problem_function; problem.o = 1; % Number of objectives problem.n = 44; % Number of variables (in total) problem.ni = 28; % Number of integer variables (0 <= ni <= n) problem.m = 18; % Number of constraints (in total) problem.me = 8; % Number of equality constraints (0 <= me <= m) problem.xl = [3 55 29 12 5 82 94 0 16 97 57 108 ... 0 7 48 88 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0]; problem.xu = [20 68 38 22 16 91 105 17 38 114 68 125 ... 23 25 74 112 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1]; problem.x = problem.xl; % Starting point: lower bounds option.maxeval = 2000000; option.maxtime = 60*60*24; option.printeval = 2000; option.save2file = 1; option.resumable = 0; option.param( 1) = 0; % ACCURACY option.param( 2) = 0; % SEED option.param( 3) = 290.5668539 + 290.5668539*1e-4; % FSTOP option.param( 4) = 0; % ALGOSTOP option.param( 5) = 0; % EVALSTOP option.param( 6) = 0; % FOCUS option.param( 7) = 0; % ANTS option.param( 8) = 0; % KERNEL option.param( 9) = 0; % ORACLE option.param(10) = 0; % PARETOMAX option.param(11) = 0; % EPSILON option.param(12) = 0; % BALANCE option.param(13) = 0; % CHARACTER option.param(14) = 0; % SURROGATE option.param(15) = 2; % PMISQP option.parallel = 0; % Serial: 0 or 1, Parallel: 2,3,4,5,6,7,8... option.paradigm = 0; % Parallel mode: 0 = parfor, 1 = vectorized [F,G] = func(X) [ solution ] = midaco( problem, option, key ); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [ f, g ] = problem_function( x ) f(1) = -(-sqrt((x(1)-x(3))^2+(x(2)-x(4))^2)*x(17) ... -sqrt((x(1)-x(5))^2+(x(2)-x(6))^2)*x(18)-sqrt((x(1)-x(7))^2+(x(2)-x(8))^2)*x(19) ... -sqrt((x(1)-x(9))^2+(x(2)-x(10))^2)*x(20) ... -sqrt((x(1)-x(11))^2+(x(2)-x(12))^2)*x(21) ... -sqrt((x(1)-x(13))^2+(x(2)-x(14))^2)*x(22) ... -sqrt((x(1)-x(15))^2+(x(2)-x(16))^2)*x(23) ... -sqrt((x(3)-x(5))^2+(x(4)-x(6))^2)*x(24)-sqrt((x(3)-x(7))^2+(x(4)-x(8))^2)*x(25) ... -sqrt((x(3)-x(9))^2+(x(4)-x(10))^2)*x(26) ... -sqrt((x(3)-x(11))^2+(x(4)-x(12))^2)*x(27) ... -sqrt((x(3)-x(13))^2+(x(4)-x(14))^2)*x(28) ... -sqrt((x(3)-x(15))^2+(x(4)-x(16))^2)*x(29) ... -sqrt((x(5)-x(7))^2+(x(6)-x(8))^2)*x(30)-sqrt((x(5)-x(9))^2+(x(6)-x(10))^2)*x(31) ... -sqrt((x(5)-x(11))^2+(x(6)-x(12))^2)*x(32) ... -sqrt((x(5)-x(13))^2+(x(6)-x(14))^2)*x(33) ... -sqrt((x(5)-x(15))^2+(x(6)-x(16))^2)*x(34) ... -sqrt((x(7)-x(9))^2+(x(8)-x(10))^2)*x(35) ... -sqrt((x(7)-x(11))^2+(x(8)-x(12))^2)*x(36) ... -sqrt((x(7)-x(13))^2+(x(8)-x(14))^2)*x(37) ... -sqrt((x(7)-x(15))^2+(x(8)-x(16))^2)*x(38) ... -sqrt((x(9)-x(11))^2+(x(10)-x(12))^2)*x(39) ... -sqrt((x(9)-x(13))^2+(x(10)-x(14))^2)*x(40) ... -sqrt((x(9)-x(15))^2+(x(10)-x(16))^2)*x(41) ... -sqrt((x(11)-x(13))^2+(x(12)-x(14))^2)*x(42) ... -sqrt((x(11)-x(15))^2+(x(12)-x(16))^2)*x(43) ... -sqrt((x(13)-x(15))^2+(x(14)-x(16))^2)*x(44))/1; g(1) = x(17)+x(18)+x(19)+x(20)+x(21)+x(22)+x(23)-2; g(2) = x(17)+x(24)+x(25)+x(26)+x(27)+x(28)+x(29)-2; g(3) = x(18)+x(24)+x(30)+x(31)+x(32)+x(33)+x(34)-2; g(4) = x(19)+x(25)+x(30)+x(35)+x(36)+x(37)+x(38)-2; g(5) = x(20)+x(26)+x(31)+x(35)+x(39)+x(40)+x(41)-2; g(6) = x(21)+x(27)+x(32)+x(36)+x(39)+x(42)+x(43)-2; g(7) = x(22)+x(28)+x(33)+x(37)+x(40)+x(42)+x(44)-2; g(8) = x(23)+x(29)+x(34)+x(38)+x(41)+x(43)+x(44)-2; g(9) = -90.3511598861612-(0.013840830449827*x(1)^2 ... -0.318339100346021*x(1)+0.0236686390532544*x(2)^2-2.9112426035503*x(2)); g(10) = -65.9797530864197-(0.0493827160493827*x(3)^2 ... -3.30864197530864*x(3)+0.04*x(4)^2-1.36*x(4)); g(11) = -372.138455259667-(0.0330578512396694*x(5)^2 ... -0.694214876033058*x(5)+0.0493827160493827*x(6)^2-8.54320987654321*x(6)); g(12) = -327.280991735537-(0.0330578512396694*x(7)^2 ... -6.57851239669422*x(7)+0.013840830449827*x(8)^2-0.235294117647059*x(8)); g(13) = -159.076696502617-(0.00826446280991736*x(9)^2 ... -0.446280991735537*x(9)+0.013840830449827*x(10)^2-2.92041522491349*x(10)); g(14) = -315.983442477623-(0.0330578512396694*x(11)^2 ... -4.13223140495868*x(11)+0.013840830449827*x(12)^2-3.22491349480969*x(12)); g(15) = -3.16049382716049-(0.00756143667296786*x(13)^2 ... -0.173913043478261*x(13)+0.0123456790123457*x(14)^2-0.395061728395062*x(14)); g(16) = -90.4621959237344-(0.00591715976331361*x(15)^2 ... -0.72189349112426*x(15)+0.00694444444444444*x(16)^2-1.38888888888889*x(16)); g(17) = 4-(x(18)+x(20)+x(21)+x(23)+x(31)+x(32)+x(34)+x(39)+x(41)+x(43)); g(18) = 4-(x(17)+x(18)+x(19)+x(22)+x(24)+x(25)+x(28)+x(30)+x(33)+x(37)); end