Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Alternative Constraint without absent logic

    Posted Tue September 17, 2019 01:21 PM

    Originally posted by: Filipe Costa


    Hi all,

    What is the best way to implement the logic behind the alternative opl function without the absent restriction: "If a is absent, then all b intervals are absent."

    Regards,


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Alternative Constraint without absent logic

    Posted Tue September 17, 2019 03:59 PM

    Hi,

    why not having interval a not optional. Then as you said "If a is absent, then all b intervals are absent."  will never have any impact

    regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Alternative Constraint without absent logic

    Posted Fri September 20, 2019 05:12 AM

    Originally posted by: Filipe Costa


    Hi Alex,

    Interval a needs to be optional in my case.

    Regards

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: Alternative Constraint without absent logic

    Posted Fri September 20, 2019 05:20 AM

    Hi,

    if the alternative is not what you need, you can write your own constraint with the presenceOf values of all needed intervals.

    (presenceOf(A)==1) => ( presenceOf(B)+presenceOf(C)<=1);

    for instance

    regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: Alternative Constraint without absent logic

    Posted Fri September 20, 2019 06:24 AM

    Originally posted by: PhilippeLaborie


    Hi Filipe, could you formalise the constraint you would like to model?

    If master interval 'a' is absent, what do you want the 'b_i' intervals to be? Completely unconstrained? Or like in the alternative: one and only one must be present? Or maybe something else ...

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 6.  Re: Alternative Constraint without absent logic

    Posted Mon September 23, 2019 05:26 AM

    Originally posted by: Filipe Costa


    Hi Philippe,

    So my master interval A is the following:

    dvar interval transformation[o in Ops] optional size ftoi(ceil(operations[o].order.volume/operations[o].machine.production_rate));

    operations is an array of tuples that represents all possible combinations between Orders, Raw materials and Machines:

    tuple Operations{
        Order order;
        Machine machine;
        Raw_material raw material;
    }

    Then I have the following constraint: Each order must be transformed once.

    I am representing this constraint like this:

    forall(m in orders){
            sum(o in Ops: operations[o].order==m) presenceOf(transformation[o])==1; // Guarantee the transformation of each mill order
        }

    But I think this constraint does not propagate well.

    Any ideas to represent this constraint in other way?

    Regards,


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 7.  Re: Alternative Constraint without absent logic

    Posted Mon September 23, 2019 12:30 PM

    Originally posted by: PhilippeLaborie


    Why don't you have an interval variable (present) that represents the interval of time an order is produced (no matter on which machine and with which material).

    Say:

    dvar interval order[m in orders] ...;

    And then some alternative enforcing that one and only one pair machine/raw material must be selected to perform this order, something like:

    forall(m in orders){
        alternative(order[m],  all(o in Ops: operations[o].order==m) transformation[o]);
    }

     

    This will ensure that one and only one pair machine/raw material is selected to perform this order m.

    And you can use interval variables  order[m] to post other constraints of your model (ex: release dates, precedence constraints between orders if any, tardiness costs, etc.)

    If there is no dependence between the allocated machines and the raw materials, you can even split the alternative as two alternatives, one on interval variables that represent the allocation of orders to machines. Another the allocation of orders to raw materials.

     


    #DecisionOptimization
    #OPLusingCPOptimizer