import java.util.HashMap; /***********************************************************************/ /* // 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. */ /***********************************************************************/ /********************* OPTIMIZATION PROBLEM ************************/ /***********************************************************************/ class Optimizationproblem { public void blackbox( double[] f, double[] g, double[] x ) { // Rename variables double x1,y1,y2; x1 = x[0]; y1 = x[1]; y2 = x[2]; // Objective function value F(X) f[0] = 0.04712385*y2 * Math.sqrt(900 + y1*y1); // Equality constraints G(X) = 0 MUST COME FIRST in g(1:me) g[0] = 420.169404664517 * Math.sqrt(900 + y1*y1) - x1*y1*y2; // Inequality constraints G(X) >= 0 MUST COME SECOND in g(me+1:m) g[1] = - x1 + 100; g[2] = 296087.631843 * (0.01+0.0625*y2*y2)/(7200+y1*y1) - x1; } } /***********************************************************************/ /************************ MAIN PROGRAM *****************************/ /***********************************************************************/ class Example { public static void main(String args[]) { int i,n; double[] x,xl,xu; HashMap problem = new HashMap (); HashMap option = new HashMap (); HashMap parameter = new HashMap (); HashMap solution = new HashMap(); String key = "MIDACO_LIMITED_VERSION___[CREATIVE_COMMONS_BY-NC-ND_LICENSE]"; /*****************************************************************/ /*** Step 1: Problem definition ********************************/ /*****************************************************************/ /* STEP 1.A: Problem dimensions ******************************/ problem.put("o", 1); /* Number of objectives */ problem.put("n", 3); /* Number of variables (in total) */ problem.put("ni", 2); /* Number of integer variables (0 <= ni <= n) */ problem.put("m", 3); /* Number of constraints (in total) */ problem.put("me", 1); /* Number of equality constraints (0 <= me <= m) */ /* STEP 1.B: Lower and upper bounds 'xl' & 'xu' **********************************************/ n = problem.get("n"); xl = new double[n]; xu = new double[n]; for(i=0;i