Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Tuple expression in mathematical expression

    Posted 02/03/19 07:44 AM

    Originally posted by: sandeepsinghchauhan


    tuple TLU
    {
    Proc a;
    int b;
    int c;
    }
    {TLU} P = ...;

     

    constraints:

    {

    forall(dv in P){

    X[dv] <= sum(pl in PL:pl.p == p.p && pl.L== dv.L+1)pl.c*M[dv]*29;

    }

    }

     

    How to write this constraint in mathematical equation form? where P and PL are constraints.

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Tuple expression in mathematical expression

    Posted 02/05/19 06:32 AM

    Hi,

    quite difficult to guess what you need to do.

    But at least

    tuple pl
    {
    int p;
    int L;
    int c;
    }

    {pl} PL={<1,2,4>,<2,3,7>};

    tuple Proc
    {
    int a;
    }
    tuple TLU
    {
    Proc a;
    int b;
    int c;
    }
    {TLU} P = {<<1>,1,2>,<<2>,1,3>};

    int M[P]=[100,100];
    dvar int+ X[P];

    constraints

    {

    forall(dv in P){

    X[dv] <= sum(pl in PL,p in PL:pl.p == p.p && pl.L== dv.b+1)pl.c*M[dv]*29;

    }

    }

    works

     

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Tuple expression in mathematical expression

    Posted 02/05/19 06:54 AM

    Originally posted by: sandeepsinghchauhan


    How to write this constraint in mathematical expression?

     

    X[dv] <= sum(pl in PL,p in PL:pl.p == p.p && pl.L== dv.b+1)pl.c*M[dv]*29;

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Tuple expression in mathematical expression

    Posted 02/05/19 06:57 AM

    Can you please clarify what you mean by "mathematical expression"?

    Isn't the above already one?


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Tuple expression in mathematical expression

    Posted 02/05/19 07:03 AM

    Originally posted by: sandeepsinghchauhan


    I mean to mathematical expression is to formulate the equation like the attached image equation. I have confusion due to tuple syntax

    " pl in PL,p in PL:pl.p == p.p && pl.L== dv.b+1) "

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Tuple expression in mathematical expression

    Posted 02/05/19 09:02 AM

    I still don't get what the problem is. The advantage of OPL is that you can basically copy the expressions verbatim to such a syntax?

    Is your problem the dot-operator as in "p.p"? If you define this notation in the surrounding text then I don't see why you cannot use that notation in the formula. If you don't like that, then for a tuple

    tuple T {
      int a;
      double b;
    }
    T tuples[I];

    that is indexed by set I in OPL you can define functions "a: I -> natural numbers" and "b: I -> real numbers" so that in the formula you can write a(i) and b(i) when in OPL you would write tuples[i].a and tuples[i].b.

    Note that math formulas become a lot more readable if you only use symbols with a single character, i.e., instead of using 'p' and 'pl' maybe use 'p' and 'k'.


    #CPLEXOptimizers
    #DecisionOptimization