From ed9fd0898af4bbee2cd14e320b3775484ed8920b Mon Sep 17 00:00:00 2001
From: someone <jan@jvales.net>
Date: Tue, 5 Jun 2012 16:57:48 +0200
Subject: [PATCH] c windfail herumprobiererei.

---
 c.dl | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)

diff --git a/c.dl b/c.dl
index aac62da..db7db55 100644
--- a/c.dl
+++ b/c.dl
@@ -21,30 +21,47 @@ p(C,o5,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), not c(C,i3,full
 p(C,o4,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), Idem > Icur, OP = 1, #int(OP).
 p(C,o5,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), Idem > Icur, OP = 0, #int(OP).
 
-% Treq = to request is <= c_max(w). request o2 = Treq.
-p(C,o2,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq <= WMAX, OP = Treq, #int(OP).
-p(C,o1,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq <= WMAX, OP = 0, #int(OP).
-p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq <= WMAX, OP = 0, #int(OP).
 
+% Treq = to request is <= c_max(w). request o2 = Treq.
+p(C,o2,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq <= WMAX, OP = Treq, #int(OP).
+p(C,o1,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq <= WMAX, OP = 0, #int(OP).
+p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq <= WMAX, OP = 0, #int(OP).
 
 % Treq > c_max(w). request o2 = c_max(w) + other
-p(C,o2,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, OP = WMAX, #int(OP).
+p(C,o2,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, OP = WMAX, #int(OP).
 
-p(C,o1,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
+p(C,o1,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
 	      not c(C,i3,empty), c_max(psh,PMAX), Treqw <= PMAX, OP = Treqw, #int(OP).
 
-p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
+p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
 	      not c(C,i3,empty), c_max(psh,PMAX), Treqw <= PMAX, OP = 0, #int(OP).
 
 % Treq > c_max(w) + c_max(psh).
-p(C,o1,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
+p(C,o1,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
 	      not c(C,i3,empty), c_max(psh,PMAX), Treqw > PMAX, OP = PMAX, #int(OP).
 
-p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
+p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
 	      not c(C,i3,empty), c_max(psh,PMAX), Treqw > PMAX, Treqwp = Treqw - PMAX, c_max(f,FMAX), Treqwp <= FMAX, OP = Treqwp, #int(OP).
 
 % Treq hopelessly over our capacity
-p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
+p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, c_max(w,WMAX), Iw >= 5, Iw <= 40, Treq > WMAX, Treqw = Treq - WMAX,
 	      not c(C,i3,empty), c_max(psh,PMAX), Treqw > PMAX, Treqwp = Treqw - PMAX, c_max(f,FMAX), Treqwp > FMAX, OP = FMAX, #int(OP).
 
 
+%windfail
+%p(C,o2,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, not Iw >= 5, not Iw <= 40, OP = 0, #int(OP).
+
+%p(C,o1,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, not Iw >= 5, not Iw <= 40, 
+%              not c(C,i3,empty), c_max(psh,PMAX), Treq <= PMAX, OP = Treq, #int(OP).
+
+%p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i4,Iw), Idem > Icur, Treq = Idem - Icur, not Iw >= 5, not Iw <= 40, 
+%              not c(C,i3,empty), c_max(psh,PMAX), Treq <= PMAX, OP = 0, #int(OP).
+
+
+
+
+%windfail
+c_max_w(Wind,WM) :- c_max(w,WMAX), Wind >= 5, Wind <= 40, WM = WMAX, #int(WM), #int(WMAX), #int(Wind).
+c_max_w(Wind,WM) :- c_max(w,WMAX), not Wind >= 5, not Wind <= 40, WM = 0, #int(WM), #int(WMAX), #int(Wind).
+
+
-- 
2.43.0