%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % 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 nvs23_surrogate key = '************************************************************'; problem.func = @problem_function; problem.o = 1; % Number of objectives problem.n = 9; % Number of variables (in total) problem.ni = 9; % Number of integer variables (0 <= ni <= n) problem.m = 9; % Number of constraints (in total) problem.me = 0; % Number of equality constraints (0 <= me <= m) problem.xl = [0 0 0 0 0 0 0 0 0]; problem.xu = [200 200 200 200 200 200 200 200 200]; problem.x = problem.xl; % Starting point: lower bounds option.maxeval = 2000; option.maxtime = 60*60*24; option.printeval = 1; option.save2file = 1; option.resumable = 0; option.param( 1) = 0; % ACCURACY option.param( 2) = 0; % SEED option.param( 3) = -1125.2 + 1125.2*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) = 3; % SURROGATE option.param(15) = 0; % 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) = 7*x(1)^2 + 6*x(2)^2 + 24.4*x(1) - 0.2*x(2) + 8*x(3)^2 - 6*x(3)*x(1) + ... 4*x(3)*x(2) + x(3) + 6*x(4)^2 + 2*x(4)*x(1) + 2*x(4)*x(3) - 39.2*x(4) + ... 7*x(5)^2 - 4*x(5)*x(1) - 2*x(5)*x(2) - 6*x(5)*x(3) - 118.4*x(5) + ... 4*x(6)^2 + 2*x(6)*x(1) - 4*x(6)*x(2) - 4*x(6)*x(3) - 2*x(6)*x(4) + ... 6*x(6)*x(5) - 73*x(6) + 6*x(7)^2 - 2*x(7)*x(1) - 6*x(7)*x(2) - ... 2*x(7)*x(3) + 4*x(7)*x(5) + 4*x(7)*x(6) - 110.8*x(7) + 7*x(8)^2 - ... 4*x(8)*x(1) - 2*x(8)*x(2) + 6*x(8)*x(3) + 4*x(8)*x(4) - 4*x(8)*x(5) - ... 2*x(8)*x(6) + 4*x(8)*x(7) - 17.8*x(8) + 8*x(9)^2 - 2*x(9)*x(1) - ... 4*x(9)*x(2) + 4*x(9)*x(3) + 4*x(9)*x(4) - 4*x(9)*x(5) - 4*x(9)*x(6) + ... 8*x(9)*x(7) + 4*x(9)*x(8) - 29.4*x(9); g(1) = (-9*x(1)^2) - 10*x(1)*x(2) - 8*x(2)^2 - 5*x(3)^2 - 6*x(3)*x(1) - ... 10*x(3)*x(2) - 7*x(4)^2 - 10*x(4)*x(1) - 6*x(4)*x(2) - 2*x(4)*x(3) - ... 2*x(5)*x(2) - 7*x(5)^2 - 6*x(6)*x(1) - 2*x(6)*x(2) - 2*x(6)*x(4) - ... 5*x(6)^2 + 6*x(7)*x(1) + 2*x(7)*x(2) + 4*x(7)*x(3) + 2*x(7)*x(4) - ... 4*x(7)*x(5) + 4*x(7)*x(6) - 8*x(7)^2 - 2*x(8)*x(1) - 8*x(8)*x(2) - ... 2*x(8)*x(3) + 6*x(8)*x(5) - 2*x(8)*x(7) - 6*x(8)^2 + 2*x(9)*x(3) - ... 4*x(9)*x(4) + 8*x(9)*x(5) + 4*x(9)*x(6) - 6*x(9)*x(8) - 6*x(9)^2 + 1850; g(2) = (-6*x(1)^2) - 8*x(1)*x(2) - 6*x(2)^2 - 4*x(3)^2 - 2*x(3)*x(1) - ... 2*x(3)*x(2) - 8*x(4)^2 + 2*x(4)*x(1) + 10*x(4)*x(2) - 2*x(5)*x(1) - ... 6*x(5)*x(2) + 6*x(5)*x(4) + 7*x(5)^2 - 2*x(6)*x(2) + 8*x(6)*x(3) + ... 2*x(6)*x(4) - 4*x(6)*x(5) - 8*x(6)^2 - 6*x(7)*x(1) - 10*x(7)*x(2) - ... 2*x(7)*x(3) + 10*x(7)*x(4) - 10*x(7)*x(5) - 8*x(7)^2 - 2*x(8)*x(1) - ... 4*x(8)*x(2) - 2*x(8)*x(3) - 8*x(8)*x(5) - 8*x(8)*x(7) - 5*x(8)^2 - ... 2*x(9)*x(1) - 2*x(9)*x(2) + 4*x(9)*x(6) + 2*x(9)*x(7) - 6*x(9)^2 + 3170; g(3) = (-9*x(1)^2) - 6*x(2)^2 - 8*x(3)^2 + 2*x(2)*x(1) + 2*x(3)*x(2) - ... 6*x(4)^2 + 4*x(4)*x(1) + 4*x(4)*x(2) - 2*x(4)*x(3) - 6*x(5)*x(1) - ... 2*x(5)*x(2) + 4*x(5)*x(4) + 6*x(5)^2 + 2*x(6)*x(1) + 4*x(6)*x(2) - ... 6*x(6)*x(4) - 2*x(6)*x(5) - 5*x(6)^2 + 2*x(7)*x(2) - 4*x(7)*x(3) - ... 6*x(7)*x(5) - 4*x(7)*x(6) - 7*x(7)^2 - 2*x(8)*x(1) + 4*x(8)*x(3) + ... 2*x(8)*x(4) - 4*x(8)^2 + 10*x(9)*x(1) + 6*x(9)*x(2) - 4*x(9)*x(3) - ... 10*x(9)*x(4) + 8*x(9)*x(5) - 6*x(9)*x(6) - 2*x(9)*x(7) - 8*x(9)^2 + ... 1770; g(4) = (-8*x(1)^2) - 4*x(2)^2 - 9*x(3)^2 - 7*x(4)^2 - 2*x(2)*x(1) - ... 2*x(3)*x(1) - 4*x(3)*x(2) + 6*x(4)*x(1) + 2*x(4)*x(2) - 2*x(4)*x(3) - ... 6*x(5)*x(1) - 4*x(5)*x(2) - 2*x(5)*x(3) + 6*x(5)*x(4) + 6*x(5)^2 - ... 10*x(6)*x(1) - 10*x(6)*x(3) + 4*x(6)*x(4) - 2*x(6)*x(5) - 7*x(6)^2 + ... 6*x(7)*x(1) - 2*x(7)*x(2) - 2*x(7)*x(3) + 6*x(7)*x(5) + 2*x(7)*x(6) - ... 6*x(7)^2 + 4*x(8)*x(1) - 4*x(8)*x(2) + 2*x(8)*x(3) - 4*x(8)*x(4) - ... 4*x(8)*x(5) + 8*x(8)*x(6) + 6*x(8)*x(6) - 8*x(8)^2 - 4*x(9)*x(1) + ... 4*x(9)*x(2) + 6*x(9)*x(3) - 2*x(9)*x(4) + 2*x(9)*x(6) + 8*x(9)*x(7) - ... 4*x(9)*x(8) - 10*x(9)^2 + 1460; g(5) = 2*x(2)*x(1) - 4*x(1)^2 - 5*x(2)^2 - 6*x(3)*x(1) - 8*x(3)^2 - ... 2*x(4)*x(1) + 6*x(4)*x(2) - 2*x(4)*x(3) - 6*x(4)^2 - 4*x(5)*x(1) + ... 2*x(5)*x(2) - 6*x(5)*x(3) - 8*x(5)*x(4) - 7*x(5)^2 + 4*x(6)*x(1) - ... 4*x(6)*x(2) + 6*x(6)*x(3) + 4*x(6)*x(5) - 7*x(6)^2 + 4*x(7)*x(1) - ... 4*x(7)*x(2) - 4*x(7)*x(3) + 4*x(7)*x(4) + 4*x(7)*x(5) + 4*x(7)*x(6) - ... 8*x(7)^2 - 2*x(8)*x(1) + 4*x(8)*x(4) + 2*x(8)*x(6) + 2*x(8)*x(7) - ... 4*x(8)^2 - 2*x(9)*x(2) + 4*x(9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