wrong Answer in MILP :sage

asked 11 years ago

Aissan_Dalvandi gravatar image

updated 11 years ago

tmonteil gravatar image

hello everyone ....

I have MILP optimization problem. when I solve the problem and use the get_values function:

Although I sets the variables BINARY but it give me real values like(+0.0) or (-0.0).... it caused I get the value wrong because when i check the value ==0 or ==1 in this case i receive the wrong answer.....

any suggestion.....???

Thanks Aissan

Preview: (hide)

Comments

There should not be any problem with that since: sage: -0.0 == 0 True sage: 0.0 == 0 True Could you provide a concrete example ?

tmonteil gravatar imagetmonteil ( 11 years ago )

yes I checked ........ I found the problem .... I used the get value, since it give me the real value sometimes it give some value near the zero or one

Aissan_Dalvandi gravatar imageAissan_Dalvandi ( 11 years ago )

I considered the if which check the value if it bigger than 0.5 it consider 1 otherwise zero ...... anyway I am so grateful for all your consideration ...

Aissan_Dalvandi gravatar imageAissan_Dalvandi ( 11 years ago )