Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  why cplex give me that solutions?

    Posted 08/12/15 09:20 AM

    Originally posted by: maffo


    Hi everybody, I don't know why in the solution of the f [n] variables it give me only 0 or 1 and not a float solution. Is there any mystake in the code?

    Thank you to all.

     

    rangen=0..9;

    floatA[n]=[33.16479327, -67.47344778, -5.940004493, 29.5089636, 68.69174626, 4.840210522, 21.07559612, -7.089604808, -4.939224516, -13.38608625];

    floatB[n]=[-593.63, 3895.672009, 1949.281166, -27.8694549, -18.9597056, 4479.880643, 904.7304375, -4993.571365, -349.6486495, 8535.998486];

    floatC[n]=[2.424937409, 15.57329839, 7.160911971, 1.267162245, 6.071135478, 0.644973685, 4.615640621, 13.68181686, 11.81301007, 8.201283407];

    inthtotmax=35;

    inthmax[n]=[6, 8, 5, 6, 8, 7, 9, 10, 6, 5];

    intj;

     

    //var decisionali

     

    dvar int+hours[n];

    dvar float+f[n];

     

    // ob.f

     

    minimize sum(j in n) A[j]*hours[j]+ B[j]*f[j] +C[j]*hours[j]*f[j];

     

    subject to{

     

    forall(j in n)

       hours[j]<=hmax[j];

    sum(j in n) hours[j]<=htotmax;

    0<=f[0]<=1;

    0<=f[1]<=1;

    0<=f[2]<=1;

    0<=f[3]<=1;

    0<=f[4]<=1;

    0<=f[5]<=1;

    0<=f[6]<=1;

    0<=f[7]<=1;

    0<=f[8]<=1;

    0<=f[9]<=1;

    }


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: why cplex give me that solutions?

    Posted 08/24/15 05:46 AM

    Hi

    at first sight this does not look strange.

    If you change the first bound into

    0<=f[0]<=0.9;

    then for f you get

    [0.9 0 0 0 0 0 0 0 0 0];

    regards

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: why cplex give me that solutions?

    Posted 08/24/15 11:00 AM

    Originally posted by: maffo


    Thank you for the reply but probably my question wasn't so clear.
    ​ I don't know why it give me everytime in every iteration f[0]=1 and the others f[n]=0.
    ​In that problem  the right solution might have some 0 and some 1 and not like the situation I have described.

    ​Thank you to all that can help me,
    ​Manuel​


    #DecisionOptimization
    #OPLusingCPLEXOptimizer