Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

cannot use type dvar boolean for user function

  • 1.  cannot use type dvar boolean for user function

    Posted 03/23/17 07:05 AM

    Originally posted by: Pradeeppsmarty


    I am trying to develop a mathematical model when i encountered the following error. "cannot use type dvar boolean for user function.

    I have attached the data, model and excel file. Please help me rectify this problem.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: cannot use type dvar boolean for user function

    Posted 03/23/17 11:18 AM

    Hi,

    you got that error because you forgot some "*" for multiply.

    forall(p in P, c in C)
          cons01:   // route contraints for slecting the routes to delivery the products ordered by the customer
          sum(s in S)X1[p][c][s]*((sum(r in R)X2[p][c][r]*(sum (d in D)X4[p][c][d]*(1-sum(b in B)X3[p][c][b]))
           +sum(b in B)X3[p][c][b]*((1-sum(d in D)X4[p][c][d])+sum(d in D)X4[p][c][d])+sum(b in B)X3[p][c][b]*(1-sum(r in R)X2[p][c][r])*((1-sum(d in D)X4[p][c][d])
           +sum(d in D)X4[p][c][d])))==1;

    will work better

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer