######################################################################## # # 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]*96 f[0] = (-(-(208.15*x[16]/(x[32] + x[33]) + 208.15*x[17]/(x[33] + x[34]) + 208.15*x[18]/(x[34] + x[35]) + 208.15*x[19]/(x[36] + x[37]) + 208.15*x[20]/(x[37] + x[38]) + 208.15*x[21]/(x[38] + x[39]) + 208.15*x[22]/(x[40] + x[41]) + 208.15*x[23]/(x[41] + x[42]) + 208.15*x[24]/(x[42] + x[43]) + 208.15*x[25]/(x[44] + x[45]) + 208.15*x[26]/(x[45] + x[46]) + 208.15*x[27]/(x[46] + x[47]) + 208.15*x[28]/(40 + x[48]) + 208.15*x[29]/(10 + x[49]) + 166.516666666667 *x[30]/(42 + x[50]) + 166.516666666667*x[31]/(37 + x[51]) + 80*x[30] + 80*x[31] + 20* x[28] + 20*x[29]) - 6250*x[52] - 6250*x[53] - 6250*x[54] - 6250*x[55] - 6250*x[56] - 6250*x[57] - 6250*x[58] - 6250*x[59] - 6250*x[60] - 6250*x[61] - 6250*x[62] - 6250*x[63] - 6250*x[64] - 6250*x[65] - 6250*x[66] - 6250*x[67])) g[0] = x[16] + x[17] + x[18] + x[19] + x[20] + x[21] + x[28] - 3300 g[1] = x[22] + x[23] + x[24] + x[25] + x[26] + x[27] + x[29] - 1800 g[2] = x[16] + x[17] + x[18] + x[22] + x[23] + x[24] + x[30] - 2300 g[3] = x[19] + x[20] + x[21] + x[25] + x[26] + x[27] + x[31] - 2400 g[4] = 30*x[0] - 30*x[1] - x[16] - x[19] g[5] = 30*x[1] - 30*x[2] - x[17] - x[20] g[6] = 30*x[2] - 30*x[3] - x[18] - x[21] g[7] = 15*x[4] - 15*x[5] - x[22] - x[25] g[8] = 15*x[5] - 15*x[6] - x[23] - x[26] g[9] = 15*x[6] - 15*x[7] - x[24] - x[27] g[10] = 20*x[8] - 20*x[9] - x[16] - x[22] g[11] = 20*x[9] - 20*x[10] - x[17] - x[23] g[12] = 20*x[10] - 20*x[11] - x[18] - x[24] g[13] = 40*x[12] - 40*x[13] - x[19] - x[25] g[14] = 40*x[13] - 40*x[14] - x[20] - x[26] g[15] = 40*x[14] - 40*x[15] - x[21] - x[27] g[16] = x[0] - 443 g[17] = x[4] - 423 g[18] = x[10] - 293 g[19] = x[14] - 353 g[20] = 30*x[2] - x[28] - 9990 g[21] = 15*x[6] - x[29] - 4545 g[22] = 20*x[8] + x[30] - 8160 g[23] = 40*x[12] + x[31] - 16520 g[24] = -(-x[0] + x[1]) g[25] = -(-x[1] + x[2]) g[26] = -(-x[2] + x[3]) g[27] = -(-x[4] + x[5]) g[28] = -(-x[5] + x[6]) g[29] = -(-x[6] + x[7]) g[30] = -(-x[8] + x[9]) g[31] = -(-x[9] + x[10]) g[32] = -(-x[10] + x[11]) g[33] = -(-x[12] + x[13]) g[34] = -(-x[13] + x[14]) g[35] = -(-x[14] + x[15]) g[36] = -(-x[2]) - 333 g[37] = -(-x[6]) - 303 g[38] = -(x[8]) + 408 g[39] = -(x[12]) + 413 g[40] = -(x[16] - 2300*x[52]) g[41] = -(x[17] - 2300*x[53]) g[42] = -(x[18] - 2300*x[54]) g[43] = -(x[19] - 2400*x[55]) g[44] = -(x[20] - 2400*x[56]) g[45] = -(x[21] - 2400*x[57]) g[46] = -(x[22] - 1800*x[58]) g[47] = -(x[23] - 1800*x[59]) g[48] = -(x[24] - 1800*x[60]) g[49] = -(x[25] - 1800*x[61]) g[50] = -(x[26] - 1800*x[62]) g[51] = -(x[27] - 1800*x[63]) g[52] = -(x[28] - 3300*x[64]) g[53] = -(x[29] - 1800*x[65]) g[54] = -(x[30] - 2300*x[66]) g[55] = -(x[31] - 2400*x[67]) g[56] = -(-x[0] + x[8] + x[32] + 150*x[52]) + 150 g[57] = -(-x[1] + x[9] + x[33] + 150*x[53]) + 150 g[58] = -(-x[2] + x[10] + x[34] + 150*x[54]) + 150 g[59] = -(-x[0] + x[12] + x[36] + 90*x[55]) + 90 g[60] = -(-x[1] + x[13] + x[37] + 90*x[56]) + 90 g[61] = -(-x[2] + x[14] + x[38] + 90*x[57]) + 90 g[62] = -(-x[4] + x[8] + x[40] + 130*x[58]) + 130 g[63] = -(-x[5] + x[9] + x[41] + 130*x[59]) + 130 g[64] = -(-x[6] + x[10] + x[42] + 130*x[60]) + 130 g[65] = -(-x[4] + x[12] + x[44] + 70*x[61]) + 70 g[66] = -(-x[5] + x[13] + x[45] + 70*x[62]) + 70 g[67] = -(-x[6] + x[14] + x[46] + 70*x[63]) + 70 g[68] = -(-x[1] + x[9] + x[33] + 150*x[52]) + 150 g[69] = -(-x[2] + x[10] + x[34] + 150*x[53]) + 150 g[70] = -(-x[3] + x[11] + x[35] + 150*x[54]) + 150 g[71] = -(-x[1] + x[13] + x[37] + 90*x[55]) + 90 g[72] = -(-x[2] + x[14] + x[38] + 90*x[56]) + 90 g[73] = -(-x[3] + x[15] + x[39] + 90*x[57]) + 90 g[74] = -(-x[5] + x[9] + x[41] + 130*x[58]) + 130 g[75] = -(-x[6] + x[10] + x[42] + 130*x[59]) + 130 g[76] = -(-x[7] + x[11] + x[43] + 130*x[60]) + 130 g[77] = -(-x[5] + x[13] + x[45] + 70*x[61]) + 70 g[78] = -(-x[6] + x[14] + x[46] + 70*x[62]) + 70 g[79] = -(-x[7] + x[15] + x[47] + 70*x[63]) + 70 g[80] = -(-x[2] + x[48]) - 313 g[81] = -(-x[6] + x[49]) - 313 g[82] = -(x[8] + x[50]) + 450 g[83] = -(x[12] + x[51]) + 450 g[84] = -(x[52] + x[58]) + 1 g[85] = -(x[53] + x[59]) + 1 g[86] = -(x[54] + x[60]) + 1 g[87] = -(x[55] + x[61]) + 1 g[88] = -(x[56] + x[62]) + 1 g[89] = -(x[57] + x[63]) + 1 g[90] = -(x[52] + x[55]) + 1 g[91] = -(x[53] + x[56]) + 1 g[92] = -(x[54] + x[57]) + 1 g[93] = -(x[58] + x[61]) + 1 g[94] = -(x[59] + x[62]) + 1 g[95] = -(x[60] + x[63]) + 1 return f, g ######################################################################## key = b'************************************************************' problem = {} option = {} problem['@'] = problem_function problem['o'] = 1 # Number of objectives problem['n'] = 68 # Number of variables (in total) problem['ni'] = 16 # Number of integer variables (0 <= ni <= n) problem['m'] = 96 # Number of constraints (in total) problem['me'] = 24 # Number of equality constraints (0 <= me <= m) problem['xl'] = [333.0, 333.0, 333.0, 333.0, 303.0, 303.0, 303.0, 303.0, 293.0, 293.0, 293.0, 293.0, 353.0, 353.0, 353.0, 353.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, 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, 1.0, 1.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'] = [443.0, 443.0, 443.0, 443.0, 423.0, 423.0, 423.0, 423.0, 408.0, 408.0, 408.0, 408.0, 413.0, 413.0, 413.0, 413.0, 10.0, 10000.0, 10.0, 50000.0, 10.0, 10.0, 50000.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10000.0, 5000.0, 10.0, 501.0, 501.0, 501.0, 11.0, 501.0, 101.0, 501.0, 11.0, 501.0, 11.0, 1001.0, 11.0, 11.0, 11.0, 11.0, 11.0, 501.0, 501.0, 501.0, 11.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'] = 2500 option['save2file'] = 1 option['resumable'] = 0 option['param1'] = 1e-06 # ACCURACY option['param2'] = 0.0 # SEED option['param3'] = 83402.50641 + 83402.50641*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)