[FlopCpp] Returning to the shell (FlopC++ constraint)
Vishy Jeet
vishv.jeet at gmail.com
Mon Feb 12 12:22:10 EST 2007
Hi,
I have written a little piece of my program below, the constraint
CostITDevCon2 is causing a problem, I can compile my program without any
errors/warnings, but when I run it, the program hangs and I don't get any
message to know what went wrong. When I remove this constraint from the
overall program everything works just fine. I think something is seriously
wrong with this constraints, don't know what. Any help on this much
appreciated.
#define bigM 10000
MP_set A(3), I(4), L(3);
MP_data curLev(A,I), itDevCost(A,I,L)
MP_constraint CostITDevCon2(A,I)
MP_index li, lj; //alias for set L
MP_variable U(A,I,L), DC(A,I);
DC.lowerLimit(A, I) = 0;
U.binary();
CostITDevCon2(A,I).such_that(curLev(A,I)>=1) =
DC(A,I) >= sum(L(li).such_that(li>curLev(A,I)-1),
(1-sum(L(lj).such_that((lj>curLev(A,I)-1) &&
(lj<=li)), U(A,I,lj)))*itDevCost(A,I,li)) +
bigM*(sum(L.such_that(L>curLev(A,I)-1),
U(A,I,L))-1);
The other strange thing is this when I write the above constraint like
below, I can't even compile my program:
CostITDevCon2(A,I).such_that(curLev(A,I)>=1) =
DC(A,I) >= sum(L(li).such_that(li>curLev(A,I)),
(1-sum(L(lj).such_that((lj>curLev(A,I)) &&
(lj<=li)), U(A,I,lj)))*itDevCost(A,I,li)) +
bigM*(sum(L.such_that(L>curLev(A,I)),
U(A,I,L))-1);
Here I just remove "-1" from all such_that blocks; everything else is just
the same.
For some verification purpose, I rewrote the entire program in GAMS/CPLEX
combo and it works just fine over there.
curLev(A,I) is the data that contains either 1, 2, or 3.
best regards,
--vishy
_______________________
Youngest Music Meastro
Mayank Sahu
http://www.mayanksahu.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/flopcpp/attachments/20070212/09d9747e/attachment.html
More information about the FlopCpp
mailing list