######################################################################## # # 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. # ######################################################################## import midaco def problem_function(x): f = [0.0]*1 g = [0.0]*74 f[0] = (-300.544*x[21] - 225.408*x[22] - 150.272*x[23] - 300.544*x[24] - 225.408*x[25] - 150.272*x[26] - 300.544*x[27] - 225.408*x[28] - 150.272*x[29] - 2.66666666666667*x[30] - 4*x[31] - 5.33333333333333*x[32] - 2.66666666666667*x[33] - 4*x[34] - 5.33333333333333*x[35] - 2.66666666666667*x[36] - 4*x[37] - 5.33333333333333*x[38] + 1.33333333333333*x[48] + x[49] + x[50] + 1.33333333333333*x[51] + x[52] + x[53] + 1.33333333333333*x[54] + x[55] + x[56] + 1.33333333333333*x[57] + x[58] + x[59] + 1.33333333333333*x[60] + x[61] + x[62] + 1.33333333333333*x[63] + x[64] + x[65]) g[0] = x[3] + x[4] + x[5] + x[12] + x[13] + x[14] - 1 g[1] = x[6] + x[7] + x[8] + x[15] + x[16] + x[17] - 1 g[2] = x[9] + x[10] + x[11] + x[18] + x[19] + x[20] - 1 g[3] = -x[45] + x[69] g[4] = -x[46] + x[70] g[5] = -x[47] + x[71] g[6] = -81.9*x[39]*x[3] + x[48] g[7] = -81.9*x[40]*x[6] + x[51] g[8] = -81.9*x[41]*x[9] + x[54] g[9] = -81.9*x[39]*x[4] + x[49] g[10] = -81.9*x[40]*x[7] + x[52] g[11] = -81.9*x[41]*x[10] + x[55] g[12] = -54.6*x[39]*x[5] + x[50] g[13] = -54.6*x[40]*x[8] + x[53] g[14] = -54.6*x[41]*x[11] + x[56] g[15] = -136.62*x[39]*x[12] + x[57] g[16] = -136.62*x[40]*x[15] + x[60] g[17] = -136.62*x[41]*x[18] + x[63] g[18] = -136.62*x[39]*x[13] + x[58] g[19] = -136.62*x[40]*x[16] + x[61] g[20] = -136.62*x[41]*x[19] + x[64] g[21] = -91.08*x[39]*x[14] + x[59] g[22] = -91.08*x[40]*x[17] + x[62] g[23] = -91.08*x[41]*x[20] + x[65] g[24] = -(x[78] + x[81] + x[84]) + 1 g[25] = -(x[79] + x[82] + x[85]) + 1 g[26] = -(x[80] + x[83] + x[86]) + 1 g[27] = (-(-3.16363636363636*x[3] - 3.16363636363636*x[4] - 3.16363636363636*x[5] + 56.3636363636364*x[78] + 43.2*x[81] + 33.8181818181818*x[84] - x[66] + x[67])) g[28] = (-(-3.16363636363636*x[6] - 3.16363636363636*x[7] - 3.16363636363636*x[8] + 56.3636363636364*x[79] + 43.2*x[82] + 33.8181818181818*x[85] - x[67] + x[68])) g[29] = -(-6.353*x[0]**0.172*x[39] + x[21] + x[22] + x[23]) g[30] = -(-6.353*x[1]**0.172*x[40] + x[24] + x[25] + x[26]) g[31] = -(-6.353*x[2]**0.172*x[41] + x[27] + x[28] + x[29]) g[32] = -(-0.32*x[0]**0.617*x[42] + x[30] + x[31] + x[32]) g[33] = -(-0.32*x[1]**0.617*x[43] + x[33] + x[34] + x[35]) g[34] = -(-0.32*x[2]**0.617*x[44] + x[36] + x[37] + x[38]) g[35] = -(x[21] + x[30] - 50*x[78]) g[36] = -(x[24] + x[33] - 50*x[79]) g[37] = -(x[27] + x[36] - 50*x[80]) g[38] = -(x[22] + x[31] - 50*x[81]) g[39] = -(x[25] + x[34] - 50*x[82]) g[40] = -(x[28] + x[37] - 50*x[83]) g[41] = -(x[23] + x[32] - 50*x[84]) g[42] = -(x[26] + x[35] - 50*x[85]) g[43] = -(x[29] + x[38] - 50*x[86]) g[44] = -(x[3] + x[12] - x[78]) g[45] = -(x[6] + x[15] - x[79]) g[46] = -(x[9] + x[18] - x[80]) g[47] = -(x[4] + x[13] - x[81]) g[48] = -(x[7] + x[16] - x[82]) g[49] = -(x[10] + x[19] - x[83]) g[50] = -(x[5] + x[14] - x[84]) g[51] = -(x[8] + x[17] - x[85]) g[52] = -(x[11] + x[20] - x[86]) g[53] = -200*x[72] + x[66] g[54] = -200*x[73] + x[67] g[55] = -200*x[74] + x[68] g[56] = -200*x[75] + x[66] g[57] = -200*x[76] + x[67] g[58] = -200*x[77] + x[68] g[59] = -x[39] + x[72] g[60] = -x[40] + x[73] g[61] = -x[41] + x[74] g[62] = -x[42] + x[75] g[63] = -x[43] + x[76] g[64] = -x[44] + x[77] g[65] = x[66]*(1 - x[45]) - x[0] - (-0.001) g[66] = x[67]*(1 - x[46]) - x[1] - (-0.001) g[67] = x[68]*(1 - x[47]) - x[2] - (-0.001) g[68] = 508*x[69] + x[66] - 200 g[69] = 508*x[70] + x[67] - 200 g[70] = 508*x[71] + x[68] - 200 g[71] = -(508*x[69] + x[66]) + 708 g[72] = -(508*x[70] + x[67]) + 708 g[73] = -(508*x[71] + x[68]) + 708 return f, g ######################################################################## key = b'************************************************************' problem = {} option = {} problem['@'] = problem_function problem['o'] = 1 # Number of objectives problem['n'] = 87 # Number of variables (in total) problem['ni'] = 18 # Number of integer variables (0 <= ni <= n) problem['m'] = 74 # Number of constraints (in total) problem['me'] = 24 # Number of equality constraints (0 <= me <= m) problem['xl'] = [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, 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, 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, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -200.0, -1.0, -1.0, -200.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 254.0, -500.0, -500.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.0, 0.0, 0.0, 0.0, 0.0] problem['xu'] = [254.001, 254.001, 1.0, 2.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 50.0, 1.0, 1.0, 50.0, 1.0, 1.0, 1.0, 1.0, 1.0, 20.0, 1.0, 1.0, 20.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 1.0, 2.0, 2.0, 1.0, 1.0, 1.0, 2.0, 200.0, 1.0, 1.0, 200.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 254.0, 500.0, 500.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] problem['x'] = list(problem['xl']) # Starting point: lower bounds option['maxeval'] = 1000000 option['maxtime'] = 60*60*24 option['printeval'] = 1000 option['save2file'] = 1 option['resumable'] = 0 option['param1'] = 1e-08 # ACCURACY option['param2'] = 2.0 # SEED option['param3'] = -9532.039053 + 9532.039053*1e-4 # FSTOP option['param4'] = 0.0 # ALGOSTOP option['param5'] = 0.0 # EVALSTOP option['param6'] = 0.0 # FOCUS option['param7'] = 0.0 # ANTS option['param8'] = 0.0 # KERNEL option['param9'] = 0.0 # ORACLE option['param10'] = 0.0 # PARETOMAX option['param11'] = 0.0 # EPSILON option['param12'] = 0.0 # BALANCE option['param13'] = 0.0 # CHARACTER option['param14'] = 0.0 # SURROGATE option['param15'] = 0.0 # PMISQP option['parallel'] = 0 # Serial: 0 or 1, Parallel: 2,3,4,5,6,7,8... option['paradigm'] = 0 # Parallel mode: 0 = multiprocessing, 1 = mpi4py, 2 = vectorized ######################################################################## if __name__ == '__main__': solution = midaco.run(problem, option, key)