Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Sum lower and upper bound

  • 1.  Sum lower and upper bound

    Posted Tue May 16, 2017 07:42 AM

    Originally posted by: rapherd


    Hi Guys,

    I have a simple and very easy question. If I'm using a sum within my model definition (in mod file) where the lower and upper bounds are equal (something like sum(t=1,...,1)(...)) is the term in the braces executed? In my expectation yes for a single time with element t=1 but I'm not cure about that and I cannot find any documentation.

     

    Thanks for helping me again

     

    Raphael


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Sum lower and upper bound

    Posted Thu May 18, 2017 02:30 AM

    I wonder what else you would expect?

    If you specify the set to be iterated over as a range with equal lower and upper bound then this range has one element. This .mod file

    range S = 1..1;
    int count = card(S);
    dvar int x[S];

    minimize sum(s in S) x[s];
    subject to { sum(s in 1..1) x[s] >= 3.0; }
    execute { writeln("count = " + count + ", x =" + x); }

    prints

    count = 1, x = [3]

    as expected.


    #CPLEXOptimizers
    #DecisionOptimization