CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C This is an example call of MIDACO 6.0 C ------------------------------------- C C MIDACO solves Multi-Objective Mixed-Integer Non-Linear Problems: C C C Minimize F_1(X),... F_O(X) where X(1,...N-NI) is CONTINUOUS C and X(N-NI+1,...N) is DISCRETE C C subject to G_j(X) = 0 (j=1,...ME) equality constraints C G_j(X) >= 0 (j=ME+1,...M) inequality constraints C C and bounds XL <= X <= XU C C C The problem statement of this example is given below. You can use C this example as template to run your own problem. To do so: Replace C the objective functions 'F' (and in case the constraints 'G') given C here with your own problem and follow the below instruction steps. C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCC MAIN PROGRAM CCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC PROGRAM MAIN IMPLICIT NONE CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C Dimensions of the optimization problem INTEGER O, N, NI, M, ME C Lower and upper bounds ('XL' & 'XU') and optimization variable 'X' DOUBLE PRECISION XL(1000), XU(1000), X(1000) C Objectives 'F(X)' and constraints 'G(X)' DOUBLE PRECISION F(10), G(1000) C MIDACO information and stop flags INTEGER IFLAG, ISTOP C MIDACO parameter DOUBLE PRECISION PARAM(13) C MIDACO integer 'IW' and real'RW' workspace and pareto front 'PF' INTEGER LIW, LRW, LPF PARAMETER (LIW = 50000, LRW = 50000, LPF = 50000) INTEGER IW(LIW) DOUBLE PRECISION RW(LRW),PF(LPF) C Parameter for stopping criteria, printing and license INTEGER MAXTIME, MAXEVAL, PRINTEVAL, SAVE2FILE, I CHARACTER*60 KEY KEY='************************************************************' CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCC Step 1: Problem definition CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C Step 1.A : Problem dimensions C CCCCCCCCCCCCCCCCCCCCCCCCCCCCC O = 1 ! Number of objectives N = 84 ! Number of variables (in total) NI = 20 ! Number of integer variables (0 <= NI <= N) M = 92 ! Number of constraints (in total) ME = 30 ! Number of equality constraints (0 <= ME <= M) C C Step 1.B : Lower and upper bounds: 'XL' and 'XU' C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC do i = 1,64 xl(i) = 0.0d0 xu(i) = 5.0d2 enddo xl(29) = 326.0d0 xu(30) = 304.0d0 xl(31) = 326.0d0 xu(32) = 304.0d0 do i = 65,n xl(i) = 0.0d0 xu(i) = 1.0d0 enddo C C Step 1.C : Starting point 'X' C CCCCCCCCCCCCCCCCCCCCCCCCCCCCC DO I = 1,N X(I) = XL(I) ! Here for example: starting point = lower bounds ENDDO CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCC Step 2: Choose stopping criteria and printing options CCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C Step 2.A : Stopping criteria C CCCCCCCCCCCCCCCCCCCCCCCCCCCC MAXEVAL = 999999999 ! Maximum evaluation budget (e.g. 1000000) MAXTIME = 60*60*24 ! Maximum time limit (e.g. 60*60*24 = 1 Day) C C Step 2.B : Printing options C CCCCCCCCCCCCCCCCCCCCCCCCCCC PRINTEVAL = 5000000 ! Print-Frequency for current best solution (e.g. 1000) SAVE2FILE = 1 ! Save SCREEN and SOLUTION to TXT-files [0=NO/1=YES] CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCC Step 3: Choose MIDACO parameters (FOR ADVANCED USERS) CCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC PARAM( 1) = 0.01D0 ! ACCURACY PARAM( 2) = 5.0D0 ! SEED PARAM( 3) = 316.694D0 ! FSTOP PARAM( 4) = 0.0D0 ! ALGOSTOP PARAM( 5) = 0.0D0 ! EVALSTOP PARAM( 6) = 100.0D0 ! FOCUS PARAM( 7) = 0.0D0 ! ANTS PARAM( 8) = 0.0D0 ! KERNEL PARAM( 9) = 320.0D0 ! ORACLE PARAM(10) = 0.0D0 ! PARETOMAX PARAM(11) = 0.0D0 ! EPSILON PARAM(12) = 0.0D0 ! BALANCE PARAM(13) = 0.0D0 ! CHARACTER CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C Call MIDACO by Reverse Communication C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C Print MIDACO headline with basic information CALL MIDACO_PRINT(1,PRINTEVAL,SAVE2FILE,IFLAG,ISTOP,F,G,X,XL, & XU,O,N,NI,M,ME,RW,PF,MAXEVAL,MAXTIME,PARAM,1,0,KEY) DO WHILE(ISTOP.EQ.0) !~~~Start~of~reverse~communication~loop C Evaluate Objective F(X) and constraints G(X) CALL PROBLEM_FUNCTION( F, G , X) C Call MIDACO CALL MIDACO(1,O,N,NI,M,ME,X,F,G,XL,XU,IFLAG, & ISTOP,PARAM,RW,LRW,IW,LIW,PF,LPF,KEY) C Call MIDACO printing routine CALL MIDACO_PRINT(2,PRINTEVAL,SAVE2FILE,IFLAG,ISTOP,F,G,X, & XL,XU,O,N,NI,M,ME,RW,PF,MAXEVAL,MAXTIME,PARAM,1,0,KEY) ENDDO !~~~~~~~~~~~~~~~~~~~~End~of~reverse~communication~loop CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC ! PRINT*," Solution F(1) = ", F(1) ! PRINT*," Solution G(1) = ", G(1) ! PRINT*," Solution X(1) = ", X(1) CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC END CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCC END OF MAIN CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCC OPTIMIZATION PROBLEM CCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC SUBROUTINE PROBLEM_FUNCTION(F,G,X) CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC IMPLICIT NONE CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC DOUBLE PRECISION F(*),G(*),X(*) CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC double precision y(20), / x2, x3, x4, x5, x6, x7, x8, x9, x10, / x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, / x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, / x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, / x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, / x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, / x61, x62, x63, x64, x65, b66, b67, b68, b69, b70, / b71, b72, b73, b74, b75, b76, b77, b78, b79, b80, / b81, b82, b83, b84, b85 double precision / e2, e3, e4, e5, e6, e7, e8, e9, e10, / e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, / e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, / e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, / e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, / e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, / e61, e62, e63, e64, e65, e66, e67, e68, e69, e70, / e71, e72, e73, e74, e75, e76, e77, e78, e79, e80, / e81, e82, e83, e84, e85, e86, e87, e88, e89, e90, / e91, e92, e93 integer i CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC do i=1,20 y(i) = x(64+i) enddo x2 = x(1) x3 = x(2) x4 = x(3) x5 = x(4) x6 = x(5) x7 = x(6) x8 = x(7) x9 = x(8) x10 = x(9) x11 = x(10) x12 = x(11) x13 = x(12) x14 = x(13) x15 = x(14) x16 = x(15) x17 = x(16) x18 = x(17) x19 = x(18) x20 = x(19) x21 = x(20) x22 = x(21) x23 = x(22) x24 = x(23) x25 = x(24) x26 = x(25) x27 = x(26) x28 = x(27) x29 = x(28) x30 = x(29) x31 = x(30) x32 = x(31) x33 = x(32) x34 = x(33) x35 = x(34) x36 = x(35) x37 = x(36) x38 = x(37) x39 = x(38) x40 = x(39) x41 = x(40) x42 = x(41) x43 = x(42) x44 = x(43) x45 = x(44) x46 = x(45) x47 = x(46) x48 = x(47) x49 = x(48) x50 = x(49) x51 = x(50) x52 = x(51) x53 = x(52) x54 = x(53) x55 = x(54) x56 = x(55) x57 = x(56) x58 = x(57) x59 = x(58) x60 = x(59) x61 = x(60) x62 = x(61) x63 = x(62) x64 = x(63) x65 = x(64) b66 = y(1) b67 = y(2) b68 = y(3) b69 = y(4) b70 = y(5) b71 = y(6) b72 = y(7) b73 = y(8) b74 = y(9) b75 = y(10) b76 = y(11) b77 = y(12) b78 = y(13) b79 = y(14) b80 = y(15) b81 = y(16) b82 = y(17) b83 = y(18) b84 = y(19) b85 = y(20) f(1) = 0.4d0*((0.003375d0*x30 - 1.15398d0)*x2 + (0.000893d0*x31 / - 0.30630793d0)*x3 + (0.004458d0*x32 - 1.57608132d0)*x4 / + (0.003176d0*x33 - 1.08593792d0)*x5 / + 31.8928571428571d0*x14/(1.0d0 + x30 - x36 - b82) / + 31.8928571428571d0*x15/(1.0d0 + x31 - x37 - b83) / + 31.8928571428571d0*x16/(1.0d0 + x32 - x34 - b84) / + 31.8928571428571d0*x17/(1.0d0 + x33 - x35 - b85) / + 151.125d0*b82 + 180.003d0*b83 + 4.2286d0*b84 + 213.42d0*b85 / + 31.8928571428571d0*x26/(1.0d0+x38-b82) / + 31.8928571428571d0*x27/(1.0d0 + x39 - b83) / + 31.8928571428571d0*x28/(1.0d0 + x40 - b84) / + 31.8928571428571d0*x29/(1.0d0 + x41 - b85) / + 31.8928571428571d0*x18/(421.0d0 - x34) / + 31.8928571428571d0*x19/(421.0d0 - x35) / + 31.8928571428571d0*x20/(421.0d0 - x36) / + 31.8928571428571d0*x21/(421.0d0 - x37) / + 31.8928571428571d0*x22/(373.0d0 - x34) / + 31.8928571428571d0*x23/(373.0d0 - x35) / + 31.8928571428571d0*x24/(373.0d0 - x36) / + 31.8928571428571d0*x25/(373.0d0 - x37)) f(1) = f(1) + 12.95216d0*x18 + 12.95216d0*x19 + 12.95216d0*x20 / + 12.95216d0*x21 + 4.75228d0*x22 + 4.75228d0*x23 / + 4.75228d0*x24 + 4.75228d0*x25 + 2.418d0*x26 + 2.418d0*x27 / + 2.418d0*x28 + 2.418d0*x29 + 1.3568d0*b66 + 1.3568d0*b67 / + 1.3568d0*b68 + 1.3568d0*b69 + 1.3568d0*b70 + 1.3568d0*b71 / + 1.3568d0*b72 + 1.3568d0*b73 + 1.3568d0*b74 + 1.3568d0*b75 / + 1.3568d0*b76 + 1.3568d0*b77 + 1.3568d0*b78 + 1.3568d0*b79 / + 1.3568d0*b80 + 1.3568d0*b81 e2 = -(0.666666666666667d0*sqrt((x30 - 305.0d0)*(x30 - 325.0d0)) / + 0.333333333333333d0*x30) + x38 - x42 + x46 + 105.0d0 e3 = -(0.666666666666667d0*sqrt((x31 - 305.0d0)*(x31 - 325.0d0)) / + 0.333333333333333d0*x31) + x39 - x43 + x47 + 105.0d0 e4 = -(0.666666666666667d0*sqrt((x32 - 305.0d0)*(x32 - 325.0d0)) / + 0.333333333333333d0*x32) + x40 - x44 + x48 + 105.0d0 e5 = -(0.666666666666667d0*sqrt((x33 - 305.0d0)*(x33 - 325.0d0)) / + 0.333333333333333d0*x33) + x41 - x45 + x49 + 105.0d0 e6 = x30 + x34 + x38 - 1500.0d0*b82 e7 = x31 + x35 + x39 - 1500.0d0*b83 e8 = x32 + x36 + x40 - 1500.0d0*b84 e9 = x33 + x37 + x41 - 1500.0d0*b85 e10 = x42 + x50 + x54 + 1500.0d0*b82 - 1500.0d0 e11 = x43 + x51 + x55 + 1500.0d0*b83 - 1500.0d0 e12 = x44 + x52 + x56 + 1500.0d0*b84 - 1500.0d0 e13 = x45 + x53 + x57 + 1500.0d0*b85 - 1500.0d0 e14 = x46 + x58 + x62 + 1500.0d0*b82 - 1500.0d0 e15 = x47 + x59 + x63 + 1500.0d0*b83 - 1500.0d0 e16 = x48 + x60 + x64 + 1500.0d0*b84 - 1500.0d0 e17 = x49 + x61 + x65 + 1500.0d0*b85 - 1500.0d0 e18 = 0.9d0*x3 - x5 e19 = 0.2d0*x2 - x4 e20 = x2 + x3 - 396.0d0 e21 = x2 - 1500.0d0*b82 e22 = x3 - 1500.0d0*b83 e23 = x4 - 1500.0d0*b84 e24 = x5 - 1500.0d0*b85 e25 = x10 - 0.0225d0*x30 - x58 + x62 - 24.7068d0 e26 = x11 - 0.013d0*x31 - x59 + x63 - 20.54087d0 e27 = x12 - 0.0043d0*x32 - x60 + x64 - 2.239778d0 e28 = x13 - 0.0156d0*x33 - x61 + x65 - 29.766048d0 e29 = x6 - x10 e30 = x7 - x11 e31 = x8 - x12 e32 = x9 - x13 e33 = x10 - x14 - x26 e34 = x11 - x15 - x27 e35 = x12 - x16 - x28 e36 = x13 - x17 - x29 e37 = x6 - x16 - x18 - x22 e38 = x7 - x17 - x19 - x23 e39 = x8 - x14 - x20 - x24 e40 = x9 - x15 - x21 - x25 e41 = x34 - 411.0d0 e42 = x35 - 411.0d0 e43 = x36 - 411.0d0 e44 = x37 - 411.0d0 e45 = -x30 + 1500.0d0*b82 - 1158.08d0 e46 = -x31 + 1500.0d0*b83 - 1156.99d0 e47 = -x32 + 1500.0d0*b84 - 1146.46d0 e48 = -x33 + 1500.0d0*b85 - 1158.08d0 e49 = -1.028d0*x30 + x34 - x50 + x54 + 341.95276d0 e50 = -1.05d0*x31 + x35 - x51 + x55 + 347.9205d0 e51 = -1.029d0*x32 + x36 - x52 + x56 + 355.03666d0 e52 = -1.005d0*x33 + x37 - x53 + x57 + 334.4486d0 e53 = -x30 + x36 + 1500.0d0*b66 - 1490.0d0 e54 = -x31 + x37 + 1500.0d0*b67 - 1490.0d0 e55 = -x32 + x34 + 1500.0d0*b68 - 1490.0d0 e56 = -x33 + x35 + 1500.0d0*b69 - 1490.0d0 e57 = x34 + 1500.0d0*b74 - 1863.0d0 e58 = x35 + 1500.0d0*b75 - 1863.0d0 e59 = x36 + 1500.0d0*b76 - 1863.0d0 e60 = x37 + 1500.0d0*b77 - 1863.0d0 e61 = x14 - 1500.0d0*b66 e62 = x15 - 1500.0d0*b67 e63 = x16 - 1500.0d0*b68 e64 = x17 - 1500.0d0*b69 e65 = x18 - 1500.0d0*b70 e66 = x19 - 1500.0d0*b71 e67 = x20 - 1500.0d0*b72 e68 = x21 - 1500.0d0*b73 e69 = x22 - 1500.0d0*b74 e70 = x23 - 1500.0d0*b75 e71 = x24 - 1500.0d0*b76 e72 = x25 - 1500.0d0*b77 e73 = x26 - 1500.0d0*b78 e74 = x27 - 1500.0d0*b79 e75 = x28 - 1500.0d0*b80 e76 = x29 - 1500.0d0*b81 e77 = x6 + x10 - 1500.0d0*b82 e78 = x7 + x11 - 1500.0d0*b83 e79 = x8 + x12 - 1500.0d0*b84 e80 = x9 + x13 - 1500.0d0*b85 e81 = b83 - b85 e82 = b82 - b84 e83 = b82 + b83 - 1.0d0 e84 = b70 + b74 - 1.0d0 e85 = b71 + b75 - 1.0d0 e86 = b72 + b76 - 1.0d0 e87 = b73 + b77 - 1.0d0 e88 = b66 + b68 - 1.0d0 e89 = b67 + b69 - 1.0d0 e90 = b66 + b68 + b70 + b74 + b78 - 20.0d0*b82 e91 = b67 + b69 + b71 + b75 + b79 - 20.0d0*b83 e92 = b66 + b68 + b72 + b76 + b80 - 20.0d0*b84 e93 = b67 + b69 + b73 + b77 + b81 - 20.0d0*b85 g(1) = e2 g(2) = e3 g(3) = e4 g(4) = e5 g(5) = e18 g(6) = e19 g(7) = e20 g(8) = e25 g(9) = e26 g(10) = e27 g(11) = e28 g(12) = e29 g(13) = e30 g(14) = e31 g(15) = e32 g(16) = e33 g(17) = e34 g(18) = e35 g(19) = e36 g(20) = e37 g(21) = e38 g(22) = e39 g(23) = e40 g(24) = e49 g(25) = e50 g(26) = e51 g(27) = e52 g(28) = e81 g(29) = e82 g(30) = e83 g(31) = -e6 g(32) = -e7 g(33) = -e8 g(34) = -e9 g(35) = -e10 g(36) = -e11 g(37) = -e12 g(38) = -e13 g(39) = -e14 g(40) = -e15 g(41) = -e16 g(42) = -e17 g(43) = -e21 g(44) = -e22 g(45) = -e23 g(46) = -e24 g(47) = -e41 g(48) = -e42 g(49) = -e43 g(50) = -e44 g(51) = -e45 g(52) = -e46 g(53) = -e47 g(54) = -e48 g(55) = -e53 g(56) = -e54 g(57) = -e55 g(58) = -e56 g(59) = -e57 g(60) = -e58 g(61) = -e59 g(62) = -e60 g(63) = -e61 g(64) = -e62 g(65) = -e63 g(66) = -e64 g(67) = -e65 g(68) = -e66 g(69) = -e67 g(70) = -e68 g(71) = -e69 g(72) = -e70 g(73) = -e71 g(74) = -e72 g(75) = -e73 g(76) = -e74 g(77) = -e75 g(78) = -e76 g(79) = -e77 g(80) = -e78 g(81) = -e79 g(82) = -e80 g(83) = -e84 g(84) = -e85 g(85) = -e86 g(86) = -e87 g(87) = -e88 g(88) = -e89 g(89) = -e90 g(90) = -e91 g(91) = -e92 g(92) = -e93 END CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCC END OF FILE CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC