Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
Expand all | Collapse all

Write OPL results to Excel by using IloOplOutputFile

  • 1.  Write OPL results to Excel by using IloOplOutputFile

    Posted Sat November 02, 2019 08:45 AM

    Originally posted by: SerkanBayram


    Hi !

     

    I'm trying to write my OPL solution's in to a excel file. The problem is I don't know how to write the solutions certain field like A2:A4. 

     

    Best Regards.   

     

    This is the example of my code. 

    execute{

    var ocD = 0

    for(var v in Vehicle){                                                    

               for(var p in Product){

                  for (var j in DC){ 

                      for (var t in Period){   

                          ocD += OC[j]* DCb[v][p][j][t];

                    }

                  }

              }

           }        

          var f=new IloOplOutputFile("OPLResults.xls");      

          f.writeln("Order_Cost ",ocD);  

          f.close();

    }


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Write OPL results to Excel by using IloOplOutputFile



  • 3.  Re: Write OPL results to Excel by using IloOplOutputFile

    Posted Sun November 03, 2019 05:11 AM

    Originally posted by: SerkanBayram


    I can use SheetWrite function only in .dat files right ? 

    Thank you so much Alex.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Write OPL results to Excel by using IloOplOutputFile

    Posted Sun November 03, 2019 05:13 AM

    yes you re right.

    SheetWrite works in .dat

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer