Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Maximal distance

    Posted 12/19/14 07:19 PM

    Originally posted by: ToshiyukiMiyamoto


    Hello,

    Is it possible to put a maximal distance constraint in a sequence?


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Maximal distance

    Posted 12/20/14 12:16 PM

    Hi,

    have you had a look at the example in

    opl\examples\opl\sched_trolley2

    ?

    regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Maximal distance

    Posted 12/22/14 06:03 AM

    Originally posted by: ToshiyukiMiyamoto


    Dear Alex

    Thank you for your reply.

    I'm checking sched_trolley2, but unfortunately the method is not good for my case.

    Let me explain my case more detail. A simple example is shown as follows:

    using CP;
    {string} Jobs = {"a", "b", "c"};
    dvar interval act[i in Jobs] size 2;
    dvar sequence ss in act;
    dvar int loc[j in Jobs] in 1..20;
    minimize max(j in Jobs) endOf(act[j]);
    subject to {
            noOverlap(ss);
            loc["a"] % 4 == 1;
            loc["b"] % 5 == 1;
            endBeforeStart( act["a"], act["c"], 2 );
            forall( j in Jobs ) startOf(act[j]) == loc[j];
    }

    There are three jobs: "a", "b", and "c". And we want to find a schedule with minmal makespan.
    Each job must be allocated to a location, and their start time depends on the location.
    The location of "a" must be 1, 5, 9, 13, or 17, and the location of "b" must be 1, 6, 11, or 16.
    The start time of "c" must be later than or equal to the end time of "a" plus 2.

    The optimal solution of this example is like this: start time of a = 1, b = 6, and c = 8.

    Then, let us add another constraint: distance between consecutive intervals must be less than or equal to 4.
    (This is the maximal distance constraint I said before.)
    The optimal solution violates this constraint, so we have to add constraints in the model.

    My question is how can I describe constraints for such a case.

    The following constraint does not work.

    forall( j in Jobs ) {
        if( typeOfNext(ss, act[j], 0) != 0 ) {
            startOfNext(ss, act[j], 0) - startOf(act[j]) <= 4 ;
        }
    }

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: Maximal distance

    Posted 12/23/14 05:03 AM

    Hi,

    instead of

    forall( j in Jobs ) {
        if( typeOfNext(ss, act[j], 0) != 0 ) {
            startOfNext(ss, act[j], 0) - startOf(act[j]) <= 4 ;
        }
    }

    have you tried

    forall( j in Jobs )
                {
                ( typeOfNext(ss, act[j], 0) != 0 )
                =>
                startOfNext(ss, act[j], 0) - startOf(act[j]) <= 4 ;
                }

    ?

    regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: Maximal distance

    Posted 12/26/14 06:48 PM

    Originally posted by: ToshiyukiMiyamoto


    Hello

    Thank you your answer. Using the answered constraints, the max distant constraint seems to work well.

     


    #DecisionOptimization
    #OPLusingCPOptimizer