Topic
  • 2 replies
  • Latest Post - ‏2013-05-28T13:56:34Z by tchesa17
tchesa17
tchesa17
3 Posts

Pinned topic problems with the program compilation

‏2013-05-24T06:14:42Z |

Hello, 

I've programemd my problem in CPLEX but I have problems with the objective function and with the constraints "ct8 and ct9". moreover, there's some data that send error that it already exists but it does not because I must be the one to initialize it.

there an attached file of the project 

I'm really requesting your help to solve this problem

Thank you

Updated on 2013-05-28T13:51:25Z at 2013-05-28T13:51:25Z by tchesa17
  • AlexFleischer
    AlexFleischer
    58 Posts

    Re: problems with the program compilation

    ‏2013-05-24T08:05:27Z  

    Hi,

     

    in ct8 you have a division by zero.

    If you rewrite into

     ct8: Div == sum(l in P, j in J:nb_soin_zone[k,j]!=0)
        (affect_soign[i,j,l,k]/nb_soin_zone[k,j]);

    it will work better

     

    regards

  • tchesa17
    tchesa17
    3 Posts

    Re: problems with the program compilation

    ‏2013-05-28T13:56:34Z  

    Hi,

     

    in ct8 you have a division by zero.

    If you rewrite into

     ct8: Div == sum(l in P, j in J:nb_soin_zone[k,j]!=0)
        (affect_soign[i,j,l,k]/nb_soin_zone[k,j]);

    it will work better

     

    regards

    thanks for the reply.

     

    you're right but normally nb_soin_zone[k,j] shouldn't take the value 0 but in the program all the matrix multiplications takes the value 0 and it's making me crazy because I don't know why. I've change the matrix dimension but it's still the same. if you could help me in this one you'll save my life.

    for example I have these constraints

    forall (i in I)
       {
    ct3:   Workload_moy[i] == sum(l in P, j in J, k in Z)(nb_soin_patien[k,l,j]*affect_soign[i,j,l,k]*tps_soin[i,j,l,k]);
     ct4: Workload_moy[i]<= dispo_soign[i];
    }

    also this one

    ct5:  Work_av == sum( j in J, l in P, k in Z)((nb_soin_patien[k,l,j]*tps_moy_soin[j])/Nb_soign);

    and this one

    forall(k in Z )
       ct7: nb_soin_zone[k] == sum(j in J, l in P)(nb_soin_patien[k,l,j]);