Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Operator not available error?

    Posted Tue December 06, 2011 08:34 PM

    Originally posted by: juliedrz


    Hello.
    I have 6 sets, A thru F (all strings) from which I have created 4 parameters (all ints..Cost, Time, Jobs, Rating). My decision variable is boolean.
    dvar boolean Y[A][B][C][D][E][F];

    The obj function is:

    minimize
    sum (n in A, l in B, k in C, i in D, m in E)
    (Cost[l][n]*Y[k][n][l][i][m]+ Time[i][l]* Y[k][n][l][i][m]+Jobs[k][m]*Y[k][n][l][i][m]*35 + (1/Rating[i]) * (1 - Y k, n, l, i, m) * 10000);

    The error I am getting is:
    Operator not available for int * dvar boolean[][E]

    Is there a known issue multiplying a boolean by an integer?
    Thank you!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Operator not available error?

    Posted Wed December 07, 2011 01:37 AM

    Originally posted by: SystemAdmin


    Y is indexed over sets A, B, C, D, E & F. In your objective function Y only seems to be indexed over A, B, C, D & E. Since 'Cost' is an int, you cannot multiply this data type by a boolean array leading to the error. Also, given that Y is indexed over those sets and in that order, you will need to make sure that the same order of Y's index appear in the objective function as well.

    With these changes, your obj function could look like the following:

    minimize
    sum (n in A, l in B, k in C, i in D, m in E, z in F)
     (Cost[l][n]*Y[n][l][k][i][m][z]+ Time[i][l]* Y[n][l][k][i][m][z]+Jobs[k][m]*Y[n][l][k][i][m][z]*35 + (1/Rating[i]) * (1 - Y[n][l][k][i][m][z] * 10000));
    

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Operator not available error?

    Posted Wed December 28, 2011 06:26 PM

    Originally posted by: juliedrz


    So after I fixed the ordering of the sets, I am still left with the issue of multiplying an integer by a boolean. How is this typically handled? Any help is greatly appreciated!
    Thank you!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Operator not available error?

    Posted Thu December 29, 2011 01:32 PM

    Originally posted by: SystemAdmin


    I donot see any error with the following code snippet:
    int Cost[B][A];
    int Time[D][B];
    int Jobs[C][E];
    int Rating[D];
    dvar boolean Y[A][B][C][D][E][F];
    minimize
    sum (n in A, l in B, k in C, i in D, m in E, z in F)
     (Cost[l][n]*Y[n][l][k][i][m][z]+ Time[i][l]* Y[n][l][k][i][m][z]+Jobs[k][m]*Y[n][l][k][i][m][z]*35 + (1/Rating[i]) * (1 - Y[n][l][k][i][m][z] * 10000));
    


    Are your data structures similar to the above. If you can post your code and the error, we can look further into it.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer