/***********************************************************************/ /* 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. */ /***********************************************************************/ /************************ MAIN PROGRAM *****************************/ /***********************************************************************/ #include #include #include "midaco.h" /* midaco_int and the MIDACO prototypes */ /***********************************************************************/ void problem_function( double *f, double *g, double *x ); /***********************************************************************/ int main(void) { /* Note: Large arrays are declared 'static' to avoid stack overflow */ /* Dimensions of the optimization problem */ midaco_int o, n, ni, m, me; /* Lower and upper bounds ('xl' & 'xu') and optimization variable 'x' */ static double xl[1000], xu[1000], x[1000]; /* Objectives 'f(x)' and constraints 'g(x)' */ static double f[10], g[1000]; /* MIDACO information and stop flags */ midaco_int iflag = 0, istop = 0; /* MIDACO parameter */ static double param[15]; /* MIDACO integer 'iw' and real 'rw' workspace and pareto front 'pf' */ static midaco_int iw[100000]; static double rw[1000000], pf[100000]; midaco_int liw, lrw, lpf, p = 1; /* Parameter for stopping criteria, printing and license */ midaco_int maxtime, maxeval, printeval, save2file, resumable, i; char key[] = "MIDACO_LIMITED_VERSION___________________ALL_RIGHTS_RESERVED"; /*****************************************************************/ /*** Step 1: Problem definition ********************************/ /*****************************************************************/ /* STEP 1.A: Problem dimensions ******************************/ o = 2; /* Number of objectives */ n = 6; /* Number of variables (in total) */ ni = 0; /* Number of integer variables (0 <= ni <= n) */ m = 6; /* Number of constraints (in total) */ me = 0; /* Number of equality constraints (0 <= me <= m) */ /* STEP 1.B: Lower and upper bounds 'xl' & 'xu' **********************************************/ xl[0] = 0.0; xu[0] = 10.0; xl[1] = 0.0; xu[1] = 10.0; xl[2] = 1.0; xu[2] = 5.0; xl[3] = 0.0; xu[3] = 6.0; xl[4] = 1.0; xu[4] = 5.0; xl[5] = 0.0; xu[5] = 10.0; /* STEP 1.C: Starting point 'x' ******************************/ for( i=0; i= 0 */ g[0] = x[0] + x[1] - 2.0; g[1] = 6.0 - x[0] - x[1]; g[2] = 2.0 - x[1] + x[0]; g[3] = 2.0 - x[0] + 3.0*x[1]; g[4] = 4.0 - pow(x[2]-3.0,2) - x[3]; g[5] = pow(x[4]-3.0,2) + x[5] - 4.0; } /***********************************************************************/ /*************************** END OF FILE *****************************/ /***********************************************************************/