Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Length of sequence types

    Posted 07/25/19 01:04 PM

    Originally posted by: Filipe Costa


    Hi all,

    Context: I need to schedule orders with different specifications (e.g., dimensions)  and types (raw material) on machines. 

    ##############################################################################################

    tuple Order{

    string id;
    string dimensions;

    int volume;
    }

    {Operations} operations = {<mo,ma>| mo in orders, ma in machines,d in dependencies : d.id==mo.id && d.machine==ma.name};

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

    dvar sequence machines_operations[ma in machines] in all(o in operations: ma.name==o.machine.name) transformation[o] types Types;

    ##########################################

    Different orders can have the same type;

    How can I model the following constraint: For each sequence machine, the production of a group of orders with dimension X With Type Y with a total volume of Z (sum of the volume of all consecutive orders with dimension X and Type Y) must be followed by the production of a group of orders with Type Y and dimension W where the total volume is equal or higher than the production of the previous group mentioned;

    I know apriori the dimensions where this need to happen;

    Ex: if this should happen for dimension small-> big

    Here´s a feasible sequence:

    O1(volume - 2, Type 1, dimension - large), O2(volume - 5, Type 2, dimension - small), O3(volume - 5, Type 2, dimension - small), O4 (volume - 7, Type 2, dimension - big), O5 (volume - 3, Type 2, dimension - big), O6(volume - 5, Type 3, dimension - small), O7 (volume - 8, Type 3, dimension - big);


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Length of sequence types

    Posted 07/26/19 09:07 AM

    Originally posted by: Petr Vilím


    Hello,

    I'm not sure I follow the exact conditions. In the example operation O4 and O5 have the same type but volume decreases. Also it seems that the change in type is allowed and in this case the volume could decrease?

    Anyway, I see two potential ways to model this kind of sequence. Both of them uses feature of "types" that could associated with interval variables that form a sequence variable. Note that those types could be different than types you already have in your problem description. Here are some links to documentation:

    Mathematical description of the concepts: https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.cplex.help/refcppcplex/html/interval_sequence.html

    OPL syntax: https://www.ibm.com/support/knowledgecenter/SSSA5P_12.5.1/ilog.odms.ide.help/OPL_Studio/opllang_quickref/topics/tlr_oplsch_sequence.html

    To make the description clear, lets call your types kinds instead. A type that could be associated with an interval variable (when it is part of a sequence variable) is an integer number preferably in a range 0..N for some N (preferably without holes). The trick is that for an interval variable in a sequence it is possible to:

    1. access type of the next interval in the sequence (i.e. type of the successor interval in the solution) using function typeOfNext
    2. specify minimum delays between intervals of different types (using transition matrix). It is even possible to effectively forbid transitions from a type to a different type using really huge delay (in this case it is necessary to indicate that the transition matrix should be used only for direct successors while creating noOverlap constraint).

    Both of those ways could be used to achieve what you need. In both cases it is necessary to encode in the type somehow all the necessary features of the operation. For example sort all the triples (volume, kind, dimension) (if dimension is really necessary) and use the index into this sorted sequence as a type. I would recommend approach 2 if the number of types is small (and so the matrix isn't big), otherwise approach 1. In approach 2 you can use constraint forbiddenAssignments (or allowedAssignments) on typeOfNext. Or use element expression in order to get dimension, type and kind from a type; however note that it is more time consuming, forbiddenAssignments are better unless unless the number of forbidden assignments isn't too big.

    Best regards, Petr


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Length of sequence types

    Posted 07/26/19 09:48 AM

    Originally posted by: Filipe Costa


    Thanks petr for your help.

    Let me try to make it more simple, for a sequence to be valid I need to guarantee that everytime I produce a group of "Small" orders (being this group of either one or multiple orders) the following group of orders must be "Big" and with total volume(quantity) higher or equal to the previous group and both groups must be of the same type.

    So why  is the previous sequence valid:

    sum of the volume of O2 and O3 (Type 2) <= volume of O4 + O5 (Type 2)

    sum of the volume of O6 (Type 3) <= volume of O7 (Type 3)

     


    #DecisionOptimization
    #OPLusingCPOptimizer