Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

How to simplify the data size in .mod file?

  • 1.  How to simplify the data size in .mod file?

    Posted 11/10/14 08:37 AM

    Originally posted by: NiuX-HNU


    Hello everyone!
         There are 1000 batteries in my model. The maximum capacity of each battery is the same. Now, I'm trying to input the maximum capacity to the .dat file. But it is quite inconvenient to input this data for 1000 times. I want to know how to solve this problem. Is there any expressions to decrease the number of data I should input to the .dat file?

         The attachment may be helpful to understand my problem.

         Best wishes!     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to simplify the data size in .mod file?

    Posted 11/11/14 02:43 PM

    Hi

    but those 1000 values are stored somewhere or do you have a formula ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: How to simplify the data size in .mod file?

    Posted 11/11/14 07:54 PM

    Originally posted by: NiuX-HNU


    Hi

    Both of the 1000 values are the same, for instance, 3e+4. They are not stored somewhere. I tried to find some useful information on the OPL reference manual yesterday, then I successfully used the internal data initialization as the following statements showed to solve my problem.

    int B=...;                                              //the amount of batteries
    range battery=1..B;                           //the range of batteries
    float gbmax[b in battery]=3e+4;     //the maximum capacity of battery b

    However, internal data initialization may has some pitfalls comparing to the internal data initialization as the OPL reference manual said. So I want know how to use external data initialization to express the same meanings as the internal data initialization does.

    Thanks a lot for your reply


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: How to simplify the data size in .mod file?

    Posted 11/12/14 01:04 AM

    hi

    then you should have a look at

    prepare

    in

    ILOG CPLEX Optimization Studio 12.6.0>IDE and OPL>Langage OPL (Optimization Programming Language)>Guide de référence rapide du langage>Mots clés OPL>prepare

    regards

     

    #DecisionOptimization
    #OPLusingCPLEXOptimizer