2016-08-24 1 views

Antwort

0

Überprüfen Sie, ob Ihr Code mit dem folgenden Standardbeispiel aus der CPLEX-Dokumentation übereinstimmt.

public static void main(String[] args) { 
     if (args.length != 1) { 
     usage(); 
     return; 
     } 
     try { 
     IloCplex cplex = new IloCplex(); 

     cplex.importModel(args[0]); 

     /* Set the solution pool relative gap parameter to obtain solutions 
      of objective value within 10% of the optimal */ 

     cplex.setParam(IloCplex.DoubleParam.SolnPoolGap, 0.1); 

     if (cplex.populate()) { 
      System.out.println("Solution status = " + cplex.getStatus()); 
      System.out.println("Incumbent objective value = " 
           + cplex.getObjValue());    

      /* Get the number of solutions in the solution pool */ 

      int numsol = cplex.getSolnPoolNsolns(); 
      System.out.println("The solution pool contains " + numsol + 
           " solutions."); 

     } 
} 

Vermissen Sie einen der Schritte wie cplex.populate().