Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  modeling vrpmtw using CP

    Posted 04/08/17 06:55 AM

    Originally posted by: AMM1


    good morning , 

    i have question regarding modeling vrpmtw using cp.

    My code is working but i have problem in  :  

    That I  have 48instances to be run and each one have different number of time windows.

    so each problem has its own model. so for now i have 48 model and 48 data file

    i put the time windows in tuple in the data file so i should define the columns in this tuple in the model itself and this was the reson why iam having 48 models  .

    **how can i make general model for all of the problems so that the number of time windows would be as variable and

    **how can i put the time windows for each client in the  data file? 


    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: modeling vrpmtw using CP

    Posted 04/18/17 03:37 AM

    Originally posted by: Petr Vilím


    Hello,

    I assume that you're using OPL since you mention data files.

    It is hard to give you exact advice without knowing more of your model. However I recommend to have a look at the OPL examples in directory opl/examples/opl, most likely one of the examples contains something similar to what you need. My guess is something like this in the .mod file:

    using CP;
    
    tuple Task {
      int start;    // Minimum start time
      int end;      // Maximum end time
      int duration;
    };
    
    {Task} Tasks = ...;
    
    dvar interval itvs[t in Tasks] in t.start..t.end size t.duration;
    

    And in the data file:

    Tasks = {
      < 1, 10, 2 >,
      < 5, 20, 5 >,
      < 7, 30, 1 >
    };
    

    Best regards, Petr


    #ConstraintProgramming-General
    #DecisionOptimization