Decision Optimization

Decision Optimization

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

 View Only
  • 1.  sum in tuples

    Posted Sat May 07, 2016 08:04 AM

    Originally posted by: sandeepsinghchauhan


    tuple A
    {
      key int toy;
      key int boys;
      key int girls;
    }  

    {A}  Child = ...;

    dvar float+ X[Child];

    maximize sum(dv in child)X[dv];

    This 'dv in child' will add 

    but i want to sum over girls only not with toy and boys


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: sum in tuples

    Posted Sat May 07, 2016 12:02 PM

    Hi

    what about

    maximize sum(dv in Child: (dv.boys==0) && (dv.toy==0) )X[dv];

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: sum in tuples

    Posted Sat May 07, 2016 12:19 PM

    Originally posted by: sandeepsinghchauhan


    dexpr float Xtotal[p in toy] = sum(dv in Child: (dv.boy==0) && (dv.girl==0) )X[dv];

     

    ERROR:


    Variable indexer size not allowed for a generic array.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: sum in tuples

    Posted Sun May 08, 2016 04:59 AM

    Hi,

    toy is not a tuple set. So "p in toy" is wrong

    Regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer