Try this:
 
Let UU=U+6 and KK K+6. So U>0 means UU>=7 and K>0 means KK>=7
UU<=6+6s1
KK<=6+6s2
s1+s2+2A<=2+2s3
s3<=D
 
s4>=D
s5+s6+2A>=3s4
UU>=7s5
KK>=7s6
 
All the s variables are binary. I am not sure, but I think it works.
 
Best wishes:
 
Kolos
 
Today's Topics:

1. Modelling constaints (john tass)


----------------------------------------------------------------------

Message: 1
Date: Thu, 26 Mar 2015 23:10:59 +0200
From: john tass <[email protected]>
To: [email protected]
Subject: [Help-glpk] Modelling constaints
Message-ID:
<cafr_-8cbvbsh-ur-d7copwnxuu1yy94eww+47pox8fvkvqv...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Good evening to every one,
I have a problem in modelling the following situation:
Let U, K in {-6, .. , 6} integers
Let A in {0, 1} binary
Let D in {0, 1} binary
What I want to do is to model the condition:
D = 1, iff (U > 0 OR K > 0) AND A = 1
Otherwise, D should equal 0.
I can not figure out how to model this situation.
Can any one give me an answear or even a hint? It would be very welcome.
Thanks a lot

--
Ioannis X. Tassopoulos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gnu.org/archive/html/help-glpk/attachments/20150326/c0a1cce1/attachment.html>

------------------------------

_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk


End of Help-glpk Digest, Vol 148, Issue 10
******************************************
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to