Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Writing constraint with sum-if condition

  • 1.  Writing constraint with sum-if condition

    Posted Fri February 08, 2013 06:41 AM

    Originally posted by: SystemAdmin


    Hi All,

    if would be great if any of you can help me writing the following constraint in JAVA concert.
    // creating integer variable , shows how many times a route is selected
    IloIntVar[] route_selected = RMPcplex.intVarArray(RRC.Route_Cost.size(), 0, 10);
    // First constraint for checking the weight of the order delivered or not
    IloLinearNumExpr order_weight = RMPcplex.linearNumExpr();

    for(int i = 0; i < RO11.Order11.size(); i++ ){
    order_weight.addTerm(RMPcplex.sum(
    for(int j =0; j<RRO.Route_Order.size(); j++)
    {
    if(RO11.Order11.getcutomerid(i)= RRO.Route_Order.getcutomerid(j) && RO11.Order11.ot(i)= RRO.Route_Order.ot(j))
    {
    RMPcplex.prod(route_selected[RRO.Route_Order.getroute(j), weight[j]);
    }

    }
    )
    }
    I am not getting how can i put this matching if condition in JAVA, which is very simple in OPL studio.

    Please help me to reformulate.

    Thanks
    Arun Lila
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Writing constraint with sum-if condition

    Posted Sat February 09, 2013 04:20 PM

    Originally posted by: SystemAdmin


    Duplicate of this thread.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Writing constraint with sum-if condition

    Posted Wed March 13, 2013 01:00 PM

    Originally posted by: SystemAdmin


    Thanks
    #CPLEXOptimizers
    #DecisionOptimization