Decision Optimization

Decision Optimization

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

 View Only
  • 1.  sequence variable

    Posted Sun February 08, 2009 09:20 PM

    Originally posted by: SystemAdmin


    [deborah said:]

    Hi!!!

    I have 2 questions about the sequence variable:

    1: Can I set the Starting Time of a sequence variable???

    For an interval variable:


    dvar interval tasks[i in 1..nJobs-1] in ftoi(round(Jobs[i].releaseData))..(maxint div 2)-1;


    or with follow constraint:


    startOf(task[i]) >= ftoi(round(Jobs[i].releaseData));


    how can I do this with a sequence variable? I need this because my machines have an earliest available time!!!

    2: Can I obtain the End Time of of a sequence variable???

    For an interval variable:


            endOf(task) // where task is an interval variable


    how can I do this with a sequence variable?

    Thanks.

    Deborah

    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: sequence variable

    Posted Wed February 11, 2009 01:32 PM

    Originally posted by: SystemAdmin


    [afleischer said:]

    Hi,

    maybe you could try

    dvar int s;
    dvar int e;

    in your declaration and

    s==min(i in 1..nJobs-1) startOf(tasks[i]);
    e==max(i in 1..nJobs-1) endOf(tasks[i]);

    in the constraint block

    Alex
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: sequence variable

    Posted Wed February 11, 2009 02:07 PM

    Originally posted by: SystemAdmin


    [phlab said:]

    Just an additional remark, if possible, it may be more efficient to avoid the definition of new additional decision variables. For instance:

    - if you only want to specify an earliest available time earliestStart[m] for a machine m, it will be better to just constrain the start time of each tasks:

    forall(m in Machines, i in Tasks) earliestStart[m] <= startOf(tasks[i][m], earliestStart[m]);<br />
    If interval variable tasks[i ][m] is optional, you must make sure the constraint is satisfied when the interval is absent, that's why a value "earliestStart[m]" is specified in the startOf expression.

    - if you want to use the "sequence end" in the cost function, it is better to directly use the integer expression. For instance (assuming you want to minimize the sum of the machines end time):


    dexpr int machineEnd[m in Machines] = max(i in Tasks) endOf(tasks[i][m]);
    minimize sum(m in Machines) machineEnd[m];


    Philippe

    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: sequence variable

    Posted Fri February 13, 2009 10:50 AM

    Originally posted by: SystemAdmin


    [phlab said:]

    For the case of the earliest start time for the resource, if the intervals are related to a unique resource with earliest start time, like the tasks[i ][m] in my code sample, it is even better to directly use the resource earliest start time in the declaration of the interval, this way, you do not have to care about the interval being absent as in the interval declaration, the minimal start represent the minimal start of the interval when the interval is present:


    int Horizon = ...;
    int Pt[i in Tasks][m in Machines] = ...;
    dvar interval tasks[i in Tasks][m in Machines] optional in earliestStart[m]..Horizon size Pt[i][m];


    Philippe
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: sequence variable

    Posted Wed March 04, 2009 07:51 PM

    Originally posted by: SystemAdmin


    [deborah said:]

    Thanks for your help...
    #DecisionOptimization
    #OPLusingCPOptimizer