Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  DARP in OPL

    Posted 02/14/20 05:06 AM

    Originally posted by: Valentin_J


    Hi everyone,

    I try to program a DARP model based on Cordeau and Laporte one, a copy actually.. :)

    Datas or note really effective yet, i want the model runnel running first.

    but first of all, I've got an issue on the last constraint and I don't know what is wrong with it :/

    It says that cplex can't extract it..

    More over I don't know how to print the solution (when it will work :D).

    thx in advance, best regards.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: DARP in OPL

    Posted 02/14/20 08:36 AM

    Originally posted by: Petr Vilím


    Hello,

    I get the following error on your files:

    ERROR[GENERATE_102] at 79:2-81:28 mod.mod: Index out of bound for array "t#22": 42.

    And indeed, array t is defined as:

    float t[N][N]=...;              //Timde needed from node i to node j
    

    And then it is accessed this way:

            forall (i in N)                         //Setting and checking ride time
              forall (k in K)
                t[i][n+i]<=r[i][k]<=L;
    

    So although i is in range N, expression i+n isn't (unless n=0).

    Regarding printing the solution, you can use OPL Script and function writeln. I recommend to have a look on some examples opl/examples/opl/*/*.mod, many of them are using writeln.

    Finally, you posted your question on CP forum. If you want to solve your problem using CP Optimizer you need "using CP;" at the beginning of the file. Otherwise it will be solved by CPLEX.

    Best regards, Petr


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: DARP in OPL

    Posted 02/14/20 10:01 AM

    Originally posted by: Valentin_J


    Thank !

    So, yes I manage to solve this issue by changing the data of "t".

    And in fact it was forall (i in P) not i in N that why it was out of bound. 

     

    I will check for example then if I have question about it I will come here :)

    Oh ok, by the way is it CPLEX or CP to solve this kind of model ?

     

    Thx you a lot.

     

    Valentin. 


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: DARP in OPL

    Posted 02/14/20 10:22 AM

    Originally posted by: Petr Vilím


    You're welcome!

    By default cplex solver is used unless there is "use CP;" at the beginning of the file.

    In your case cplex is the only option because there are floating-point decision variables (CP has only integer decision variables and floating-point expressions). On the other hand CP has more powerful language. To use its power you would need to remodel the problem (if integer decision variables would be enough).

    Petr


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: DARP in OPL

    Posted 02/17/20 02:31 AM

    Originally posted by: Valentin_J


    Thank again Petr,

    Unfortunatly, it will be hard to remodel it, in one hand because I've got float for the time of traveling and for distances, in a over hand I don't even know if the model for a Dial a Ride Problem can be integer decision maker.

    By the way do you know what is Error 5002 ? it says that one of my variable 'q1' is not convex. what does it mean ?

    Have a good day,

    Valentin.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 6.  Re: DARP in OPL

    Posted 02/17/20 03:22 AM

    Originally posted by: Petr Vilím


    Hello Valentin,

    I'm sorry, I don't know about Error 5002. Please ask in CPLEX forum here:

    https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000002059

    Petr


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 7.  Re: DARP in OPL

    Posted 02/17/20 03:54 AM

    Originally posted by: Valentin_J


    It's ok thank a lot for your help.

    here is the link of my new topic for the convex error if someone is getting the same issue so he could fix it.

     https://www.ibm.com/developerworks/community/forums/html/topic?id=cc4ab098-f529-4212-aa05-63fc6cb8e019

     

    Bye have a nice day,

     

    Valentin.


    #DecisionOptimization
    #OPLusingCPOptimizer