/***********************************************************************/ /* // This is an example call of MIDACO 6.0 // ------------------------------------- // // 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. */ /***********************************************************************/ #include /* OpenMP-Library */ #include #include #include #include double gettime(){time_t second;second=time(NULL);return (double)second;} /***********************************************************************/ void problem_function( double *F, double *G, double *X, int GTOP_PROBLEM, long int n); /***********************************************************************/ extern"C"{ int midaco(long int*,long int*,long int*,long int*,long int*, long int*,double*,double*,double*,double*,double*, long int*,long int*,double*,double*,long int*, long int*,long int*,double*,long int*,char*);} /***********************************************************************/ extern"C"{ int midaco_print(int,long int,long int,long int*,long int*,double*, double*,double*,double*,double*,long int,long int, long int,long int,long int,double*,double*, long int,long int,double*,long int,char*);} /***********************************************************************/ /************************ MAIN PROGRAM *****************************/ /***********************************************************************/ int main() { /* 1) Cassini1 2) GTOC1 3) Messenger_Full 4) Messenger_Reduced 5) Cassini2 6) Rosetta 7) Sagas */ int GTOP_PROBLEM = 2; /* Select GTOP Benchmark Problem */ /* Variable and Workspace Declarations */ long int o,n,ni,m,me,maxeval,maxtime,printeval,save2file,iflag,istop; long int liw,lrw,lpf,i,iw[50000],p=1; double rw[50000],pf[50000]; double f[10],g[1000],x[1000],xl[1000],xu[1000],param[13]; char key[] = "************************************************************"; /*****************************************************************/ /*** Step 1: Problem definition ********************************/ /*****************************************************************/ /* STEP 1.A: Problem dimensions ******************************/ o = 1; /* Number of objectives */ /* Adjust dimension n and m to specific GTOP Problem */ if(GTOP_PROBLEM == 1){n= 6; m=4;} if(GTOP_PROBLEM == 2){n= 8; m=6;} if(GTOP_PROBLEM == 3){n=26; } if(GTOP_PROBLEM == 4){n=18; } if(GTOP_PROBLEM == 5){n=22; } if(GTOP_PROBLEM == 6){n=22; } if(GTOP_PROBLEM == 7){n=12; m=2;} /* STEP 1.B: Define lower and upper bounds 'xl' & 'xu' */ /* *************************************************** */ double pi = 3.14159265359; double fex = 0.0; /* initialize best known value */ if( GTOP_PROBLEM == 1 ){ fex = 4.93075; double lower[] = {-1000,30,100,30,400,1000}; double upper[] = {0,400,470,400,2000,6000}; for( i=0; i #define VENUS 2 #define EARTH 3 #define MARS 4 #define JUPITER 5 #define SATURN 6 /***********************************************************************/ /***********************************************************************/ /***********************************************************************/ void problem_function(double *f, double *g, double *x, int GTOP_PROBLEM, long int n) { double DVtot, DVonboard; std::vector solution, rp; for (int i=0; i