Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  ILOG CPLEX SCRIPT Problem

    Posted 06/02/16 12:17 PM

    Originally posted by: Userhtwg


    Hey Guys,

    I have some problems with a simple ILOG script. I tried to manipulate two values over a nested for-loop in which the names of the .dat-files are iterated. Some parameters are initialized in .dat-files and results shall be written into an excel sheet.

    The Problem formulation:

    Case A- If we copy the script into the .mod-file we get five error messages because of undefined variables ("testmodel 1") although all variables are defined in the .mod-file.

    Case B- If we separate the ILOG script and the model definition into two different files we don't get an error message and no data will be written into the Excel sheet ("testmodel 2").

    I use a WIN-7 64-Bit machine with the ILOG CPLEX Optimization Studio (ILOG Cplex Solver Version 12.6) and the 2010 Excel Version.

    I will provide all files in the attachment. Could someone help me with some suggestions? I think the connection to the Excel-Sheet makes some problems but I can't handle it.

    Thank you

    Bye Kamil


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: ILOG CPLEX SCRIPT Problem

    Posted 06/03/16 02:53 AM

    Hi

    case 1 does not work because you have some values that should be defined somewhere but they are not.

    (The = ... in the .mod)

    So if you add a new file hallo.dat

    Strombedarf=0;
    InvestKosten_PV=0;

    and then do

    oplrun Ablaufsteuerung.mod hallo.dat

    instead of

    oplrun Ablaufsteuerung.mod

    execution will go further

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: ILOG CPLEX SCRIPT Problem

    Posted 06/07/16 03:06 AM

    Originally posted by: Userhtwg


    Hi Alex,

     

    thanks for the fast replay. I tried case 1 with your suggestions. It start without any error.

    But the Excel-Sheet is after the execution empty.

    Could you give me one more hint?

     

    Thanks Kamil


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: ILOG CPLEX SCRIPT Problem

    Posted 06/07/16 03:29 AM

    Hi,

    ok I give you one hint:

    You wrote

    opl.generate();
    cplex.solve();

    which does not call the postProcess which is in charge of calling sheetwrite, you should rather write

    opl.generate();

    cplex.solve();
    opl.postProcess(); 

    And then it will work fine

    regards

     

     

     

                         

     

     

     

                      


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: ILOG CPLEX SCRIPT Problem

    Posted 06/07/16 03:44 AM

    Originally posted by: Userhtwg


    Hi Alex,

     

    thanks very much for the quick answer. Everything works fine.

     

    Bye Kamil


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: ILOG CPLEX SCRIPT Problem

    Posted 08/09/16 05:28 PM

    Originally posted by: MapleHu


    Hi, 

    I have the same problem with you. Does "call the postProcess" just mean one line of codes above(opl.postProcess)? My sheetwrite still doesn't work. Any other operation needed? 

    I'm very confused with that. Thanks in advance.

    Maple


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: ILOG CPLEX SCRIPT Problem

    Posted 08/22/16 11:35 AM

    Hi,

    yes that is calling postProcess

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer