Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Aggregate And Operator

    Posted 06/26/15 04:25 PM

    Originally posted by: mathygirl


    I was wondering if there is an aggregate "and" operator in opl/opl script. I'd like to perform the following operation in compact form:

     

    a_1 and a_2 and a_3 and a_4 and a_5 and ... and a_n.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Aggregate And Operator

    Posted 06/27/15 12:55 AM

    You may want to ask this question in the OPL Forum.

    One (ugly) way of doing this that comes to mind would be to introduce boolean helper variables:

    dvar boolean help[1..n];
    ...
    forall(i in 1..n) help[i] == (a_i); // help[i]==1 iff a_i is true
    sum(i in 1..n) help[i] == n;        // all help[i] must be 1

    This is not easy to read but is close to what the CPLEX engine would make of your aggregated and anyway.


    #CPLEXOptimizers
    #DecisionOptimization