Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  how to read my data file

    Posted 04/19/17 01:29 PM

    Originally posted by: khadeejah


    Hi All,

           I insert my data in the data file, i want to make sure that cplex read it as i meant it to be. is there such a command to read the data as cplex?

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: how to read my data file

    Posted 04/19/17 03:17 PM

    Hi,

    is your data an excel file or flat data ?

    Anyway in a .dat you can have some scripting. (prepare/invoke)

    In the .mod you may use assert in order to check some assertions

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: how to read my data file

    Posted 04/20/17 02:53 AM

    Originally posted by: khadeejah


    Thanks alot Alex.

    it's a .dat.

    I'll do what you've suggested.

    Thanks again.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: how to read my data file

    Posted 04/20/17 01:52 PM

    Originally posted by: khadeejah


    I read the help for (prepare/invoke).

    My problem is that i have a demand that should be satisfied by period 3, one of the decision variables displays results beyond period 3 !!! thats why i thought maybe cplex is not reading my data as i meant it to be and hence i have to use a syntax to guarantee a correct declaration of the data; however  there are no errors in the mod nor data files.

    so what is the right way to trigger the pitfall of the data? is it by using prepare/invoke or they should be used together. if so may you provide a simple example? 

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: how to read my data file

    Posted 04/20/17 02:17 PM

    If possible, I prefer to add asserts in the .mod

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: how to read my data file

    Posted 04/20/17 02:50 PM

    Originally posted by: khadeejah


    i put it before the constraint that produces such weird result, as follows: 

     assert   
    forall ( i in MTOprod, s in stages, t in periods: t-1>=1 && s+1 in stages)
    ctinv6: RQist [i][s][t]+ OQist [i][s][t]+ IQist [i][s][t-1]-RQist [i][s+1][t]- OQist [i][s+1][t]== IQist [i][s][t];

     

    but i had an error : unexpected assert.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: how to read my data file

    Posted 04/20/17 02:56 PM

    Hi

    the assert should not be in the subject to block but before

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: how to read my data file

    Posted 04/20/17 03:00 PM

    Originally posted by: khadeejah


    you mean by block,

    that it ignore / block that constraint so it doesnt execute it??


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 9.  Re: how to read my data file

    Posted 04/21/17 03:10 AM

    Hi,

    I mean "assert" should not be in the "subject to" block.

    Let me give you an example:

    int n=3;

    assert n<=4;

    dvar int x;
    maximize x;
    subject to
    {
    x<=n;
    }

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer