######################################################################## # # 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]*43 f[0] = ((-0.0139904-0.0005719*x[26]+0.0042656*x[27] +0.0093514*x[44]+0.0077308*x[45])*x[2]+(-0.0661588 +0.0016371*x[29]+0.0288996*x[30]+0.0338147*x[46] +0.0373349*x[47])*x[3]+0.23947*x[48]+0.75835*x[49]) g[0] = x[0]+x[1]+x[18]+x[19]-300.0 g[1] = x[4]-x[10]-x[11] g[2] = x[5]-x[9]-x[12]-x[13] g[3] = x[6]-x[8]-x[14]-x[15] g[4] = x[7]-x[16]-x[17] g[5] = -x[8]*x[38]-0.333333333333333*x[0]+x[20] g[6] = -x[8]*x[39]-0.333333333333333*x[0]+x[21] g[7] = -x[8]*x[40]-0.333333333333333*x[0]+x[22] g[8] = -x[9]*x[35]-0.333333333333333*x[1]+x[23] g[9] = -x[9]*x[36]-0.333333333333333*x[1]+x[24] g[10] = -x[9]*x[37]-0.333333333333333*x[1]+x[25] g[11] = -(x[4]*x[32]+x[5]*x[35])+x[20] g[12] = -(x[4]*x[33]+x[5]*x[36])+x[21] g[13] = -(x[4]*x[34]+x[5]*x[37])+x[22] g[14] = -(x[6]*x[38]+x[7]*x[41])+x[23] g[15] = -(x[6]*x[39]+x[7]*x[42])+x[24] g[16] = -(x[6]*x[40]+x[7]*x[43])+x[25] g[17] = x[20]*x[44]-x[4]*x[32] g[18] = x[21]*x[45]-x[5]*x[36] g[19] = x[24]*x[46]-x[6]*x[39] g[20] = x[25]*x[47]-x[7]*x[43] g[21] = x[10]*x[32]+x[12]*x[35]+x[14]*x[38]+x[16]*x[41]+0.333333333333333*x[18]-80.0 g[22] = x[10]*x[33]+x[12]*x[36]+x[14]*x[39]+x[16]*x[42]+0.333333333333333*x[18]-30.0 g[23] = x[10]*x[34]+x[12]*x[37]+x[14]*x[40]+x[16]*x[43]+0.333333333333333*x[18]-20.0 g[24] = x[11]*x[32]+x[13]*x[35]+x[15]*x[38]+x[17]*x[41]+0.333333333333333*x[19]-20.0 g[25] = x[11]*x[33]+x[13]*x[36]+x[15]*x[39]+x[17]*x[42]+0.333333333333333*x[19]-70.0 g[26] = x[11]*x[34]+x[13]*x[37]+x[15]*x[40]+x[17]*x[43]+0.333333333333333*x[19]-80.0 g[27] = x[2]*x[26]-x[20] g[28] = x[2]*x[27]-x[21] g[29] = x[2]*x[28]-x[22] g[30] = x[3]*x[29]-x[23] g[31] = x[3]*x[30]-x[24] g[32] = x[3]*x[31]-x[25] g[33] = x[32]+x[33]+x[34]-1.0 g[34] = x[35]+x[36]+x[37]-1.0 g[35] = x[38]+x[39]+x[40]-1.0 g[36] = x[41]+x[42]+x[43]-1.0 g[37] = x[26]+x[27]+x[28]-1.0 g[38] = x[29]+x[30]+x[31]-1.0 g[39] = x[34] g[40] = x[41] g[41] = -(x[2]-300.0*x[48]) g[42] = -(x[3]-300.0*x[49]) return f, g ######################################################################## key = b'************************************************************' problem = {} option = {} problem['@'] = problem_function problem['o'] = 1 # Number of objectives problem['n'] = 50 # Number of variables (in total) problem['ni'] = 2 # Number of integer variables (0 <= ni <= n) problem['m'] = 43 # Number of constraints (in total) problem['me'] = 41 # 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.85, 0.85, 0.85, 0.85, 0.0, 0.0] problem['xu'] = [300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 300.0, 1000.0, 500.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.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, 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'] = 500 option['save2file'] = 1 option['resumable'] = 0 option['param1'] = 0.0001 # ACCURACY option['param2'] = 0.0 # SEED option['param3'] = 0.62596741 + 0.62596741*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'] = 2.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)