Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  problem with running my model

    Posted 11/04/11 07:23 AM

    Originally posted by: february_Birthed


    Hello ,
    I am trying to write cp code for golomb ruler problem
    but OPL shows error on this line :

    in the following code I want to calculate the value x[i] - x[j] and put the value in array d that has n*n(n+1)/2 elements but it shows error

    forall(i,j in 1..n: j>i)dk in ftoi(n*(n+1))/2==abs(x[i] - x[j]) ;
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: problem with running my model

    Posted 11/04/11 03:01 PM

    Originally posted by: SystemAdmin


    I am not able to completely understand your indexes because you mention that d has n*n(n+1)/2 elements, but in your forall statement d's index k, seems to be iterating over n*(n+1)/2 elements. In any case, you may want to use a syntax like the following and see if that works:
    forall(i,j in 1..n,k in 1..ftoi(n*(n+1)/2):j>i)
      d[k]==abs(x[i] - x[j]);
    


    If you are still having problems, please post your code within {code} tags so that the formatting is maintained.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer