From 4a2bd183fe9c30eb8e33f4fbbf4ec5f53cc1f84f Mon Sep 17 00:00:00 2001 From: someone Date: Tue, 5 Jun 2012 15:11:07 +0200 Subject: [PATCH] c updates --- c.dl | 21 +++++++++++++++++++++ c.test1.dl | 30 +++++++++++++++--------------- c.test2.dl | 26 +++++++++++++------------- c.test3.dl | 30 +++++++++++++++--------------- c.test4.dl | 30 +++++++++++++++--------------- c.test5.dl | 26 +++++++++++++------------- c.test6.dl | 26 +++++++++++++------------- c.test7.dl | 26 +++++++++++++------------- 8 files changed, 118 insertions(+), 97 deletions(-) diff --git a/c.dl b/c.dl index e69de29..c189894 100644 --- a/c.dl +++ b/c.dl @@ -0,0 +1,21 @@ +% control definition. +% o1: psh, o2:w, o3:f, o4:s, o5:scharge + +% Treq = to request is <= c_max(w). request o2 = Treq. +p(C,o1,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i3,Istor), c(C,i4,Iwind), Treq = Idem - Icur, + c_max(w,WMAX), Iwind >= 5, Iwind <= 40, Treq <= WMAX, OP = 0, #int(OP). + +p(C,o2,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i3,Istor), c(C,i4,Iwind), Treq = Idem - Icur, + c_max(w,WMAX), Iwind >= 5, Iwind <= 40, Treq <= WMAX, OP = Treq, #int(OP). + +p(C,o3,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i3,Istor), c(C,i4,Iwind), Treq = Idem - Icur, + c_max(w,WMAX), Iwind >= 5, Iwind <= 40, Treq <= WMAX, OP = 0, #int(OP). + +p(C,o4,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i3,Istor), c(C,i4,Iwind), Treq = Idem - Icur, + c_max(w,WMAX), Iwind >= 5, Iwind <= 40, Treq <= WMAX, OP = 1, #int(OP). + +p(C,o5,OP) :- not ab(C), control(C), c(C,i1,Icur), c(C,i2,Idem), c(C,i3,Istor), c(C,i4,Iwind), Treq = Idem - Icur, + c_max(w,WMAX), Iwind >= 5, Iwind <= 40, Treq <= WMAX, OP = 0, #int(OP). + + + diff --git a/c.test1.dl b/c.test1.dl index 7ae5400..ea7e078 100644 --- a/c.test1.dl +++ b/c.test1.dl @@ -16,43 +16,43 @@ c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). control(c). % define control i1/L_cur to 10KW -c(s,i1,10). +c(c,i1,10). % define control i2/L_demand to 20KW -c(s,i2,20). +c(c,i2,20). % define control i3/Sstorage to half_full -c(s,i3,half_full). +c(c,i3,half_full). % define control i4/Swind to 10 -c(s,i4,10). +c(c,i4,10). % test definition. % expecting i1 to be 10 -expect_c(s,i1,10). +expect_c(c,i1,10). % expecting i2 to be 20 -expect_c(s,i2,20). +expect_c(c,i2,20). % expecting i3 to be half_full -expect_c(s,i3,half_full). +expect_c(c,i3,half_full). % expecting i4 to be 10 -expect_c(s,i4,10). - -% and request 10KW -expect_p(s,o1,10). +expect_c(c,i4,10). % and request 0KW -expect_p(s,o2,0). +expect_p(c,o1,0). + +% and request 10KW +expect_p(c,o2,10). % and request 0KW -expect_p(s,o3,0). +expect_p(c,o3,0). % do we enable the switching station? -expect_p(s,o4,1). +expect_p(c,o4,1). % and we charge out pumpspeicherkraftwerk with 0KW -expect_p(s,o5,0). +expect_p(c,o5,0). diff --git a/c.test2.dl b/c.test2.dl index 651ced4..a02556c 100644 --- a/c.test2.dl +++ b/c.test2.dl @@ -16,43 +16,43 @@ c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). control(c). % define control i1/L_cur to 10KW -c(s,i1,10). +c(c,i1,10). % define control i2/L_demand to 40KW -c(s,i2,40). +c(c,i2,40). % define control i3/Sstorage to half_full -c(s,i3,half_full). +c(c,i3,half_full). % define control i4/Swind to 10 -c(s,i4,10). +c(c,i4,10). % test definition. % expecting i1 to be 10 -expect_c(s,i1,10). +expect_c(c,i1,10). % expecting i2 to be 40 -expect_c(s,i2,40). +expect_c(c,i2,40). % expecting i3 to be half_full -expect_c(s,i3,half_full). +expect_c(c,i3,half_full). % expecting i4 to be 10 -expect_c(s,i4,10). +expect_c(c,i4,10). % and request 15KW -expect_p(s,o1,15). +expect_p(c,o1,15). % and request 15KW -expect_p(s,o2,15). +expect_p(c,o2,15). % and request 0KW -expect_p(s,o3,0). +expect_p(c,o3,0). % do we enable the switching station? -expect_p(s,o4,1). +expect_p(c,o4,1). % and we charge out pumpspeicherkraftwerk with 0KW -expect_p(s,o5,0). +expect_p(c,o5,0). diff --git a/c.test3.dl b/c.test3.dl index 4210145..f64af1c 100644 --- a/c.test3.dl +++ b/c.test3.dl @@ -16,43 +16,43 @@ c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). control(c). % define control i1/L_cur to 10KW -c(s,i1,10). +c(c,i1,10). % define control i2/L_demand to 60KW -c(s,i2,60). +c(c,i2,60). % define control i3/Sstorage to half_full -c(s,i3,half_full). +c(c,i3,half_full). % define control i4/Swind to 10 -c(s,i4,10). +c(c,i4,10). % test definition. % expecting i1 to be 10 -expect_c(s,i1,10). +expect_c(c,i1,10). % expecting i2 to be 60 -expect_c(s,i2,60). +expect_c(c,i2,60). % expecting i3 to be half_full -expect_c(s,i3,half_full). +expect_c(c,i3,half_full). % expecting i4 to be 10 -expect_c(s,i4,10). - -% and request 15KW -expect_p(s,o1,15). +expect_c(c,i4,10). % and request 20KW -expect_p(s,o2,20). +expect_p(c,o1,20). + +% and request 15KW +expect_p(c,o2,15). % and request 15KW -expect_p(s,o3,15). +expect_p(c,o3,15). % do we enable the switching station? -expect_p(s,o4,1). +expect_p(c,o4,1). % and we charge out pumpspeicherkraftwerk with 0KW -expect_p(s,o5,0). +expect_p(c,o5,0). diff --git a/c.test4.dl b/c.test4.dl index 36ca838..b5ba2d5 100644 --- a/c.test4.dl +++ b/c.test4.dl @@ -16,43 +16,43 @@ c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). control(c). % define control i1/L_cur to 10KW -c(s,i1,10). +c(c,i1,10). % define control i2/L_demand to 60KW -c(s,i2,60). +c(c,i2,60). % define control i3/Sstorage to half_full -c(s,i3,half_full). +c(c,i3,half_full). % define control i4/Swind to 50 -c(s,i4,50). +c(c,i4,50). % test definition. % expecting i1 to be 10 -expect_c(s,i1,10). +expect_c(c,i1,10). % expecting i2 to be 60 -expect_c(s,i2,60). +expect_c(c,i2,60). % expecting i3 to be half_full -expect_c(s,i3,half_full). +expect_c(c,i3,half_full). % expecting i4 to be 50 -expect_c(s,i4,50). - -% and request 0KW -expect_p(s,o1,0). +expect_c(c,i4,50). % and request 20KW -expect_p(s,o2,20). +expect_p(c,o1,20). + +% and request 0KW +expect_p(c,o2,0). % and request 30KW -expect_p(s,o3,30). +expect_p(c,o3,30). % do we enable the switching station? -expect_p(s,o4,1). +expect_p(c,o4,1). % and we charge out pumpspeicherkraftwerk with 0KW -expect_p(s,o5,0). +expect_p(c,o5,0). diff --git a/c.test5.dl b/c.test5.dl index 8d45b11..fbe33c2 100644 --- a/c.test5.dl +++ b/c.test5.dl @@ -16,43 +16,43 @@ c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). control(c). % define control i1/L_cur to 10KW -c(s,i1,10). +c(c,i1,10). % define control i2/L_demand to 60KW -c(s,i2,60). +c(c,i2,60). % define control i3/Sstorage to empty -c(s,i3,empty). +c(c,i3,empty). % define control i4/Swind to 50 -c(s,i4,50). +c(c,i4,50). % test definition. % expecting i1 to be 10 -expect_c(s,i1,10). +expect_c(c,i1,10). % expecting i2 to be 60 -expect_c(s,i2,60). +expect_c(c,i2,60). % expecting i3 to be half_full -expect_c(s,i3,empty). +expect_c(c,i3,empty). % expecting i4 to be 50 -expect_c(s,i4,50). +expect_c(c,i4,50). % and request 0KW -expect_p(s,o1,0). +expect_p(c,o1,0). % and request 0KW -expect_p(s,o2,0). +expect_p(c,o2,0). % and request 50KW -expect_p(s,o3,50). +expect_p(c,o3,50). % do we enable the switching station? -expect_p(s,o4,1). +expect_p(c,o4,1). % and we charge out pumpspeicherkraftwerk with 0KW -expect_p(s,o5,0). +expect_p(c,o5,0). diff --git a/c.test6.dl b/c.test6.dl index d6fcc78..016d6a3 100644 --- a/c.test6.dl +++ b/c.test6.dl @@ -16,43 +16,43 @@ c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). control(c). % define control i1/L_cur to 20KW -c(s,i1,20). +c(c,i1,20). % define control i2/L_demand to 10KW -c(s,i2,10). +c(c,i2,10). % define control i3/Sstorage to empty -c(s,i3,empty). +c(c,i3,empty). % define control i4/Swind to 0 -c(s,i4,0). +c(c,i4,0). % test definition. % expecting i1 to be 20 -expect_c(s,i1,20). +expect_c(c,i1,20). % expecting i2 to be 10 -expect_c(s,i2,10). +expect_c(c,i2,10). % expecting i3 to be empty -expect_c(s,i3,empty). +expect_c(c,i3,empty). % expecting i4 to be 0 -expect_c(s,i4,0). +expect_c(c,i4,0). % and request 0KW -expect_p(s,o1,0). +expect_p(c,o1,0). % and request 0KW -expect_p(s,o2,0). +expect_p(c,o2,0). % and request 0KW -expect_p(s,o3,0). +expect_p(c,o3,0). % do we enable the switching station? -expect_p(s,o4,2). +expect_p(c,o4,2). % and we charge out pumpspeicherkraftwerk with 10KW -expect_p(s,o5,10). +expect_p(c,o5,10). diff --git a/c.test7.dl b/c.test7.dl index fd074e8..5aa8400 100644 --- a/c.test7.dl +++ b/c.test7.dl @@ -16,43 +16,43 @@ c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). control(c). % define control i1/L_cur to 10KW -c(s,i1,10). +c(c,i1,10). % define control i2/L_demand to 10KW -c(s,i2,10). +c(c,i2,10). % define control i3/Sstorage to empty -c(s,i3,empty). +c(c,i3,empty). % define control i4/Swind to 0 -c(s,i4,0). +c(c,i4,0). % test definition. % expecting i1 to be 0 -expect_c(s,i1,0). +expect_c(c,i1,0). % expecting i2 to be 0 -expect_c(s,i2,0). +expect_c(c,i2,0). % expecting i3 to be empty -expect_c(s,i3,empty). +expect_c(c,i3,empty). % expecting i4 to be 0 -expect_c(s,i4,0). +expect_c(c,i4,0). % and request 0KW -expect_p(s,o1,0). +expect_p(c,o1,0). % and request 0KW -expect_p(s,o2,0). +expect_p(c,o2,0). % and request 0KW -expect_p(s,o3,0). +expect_p(c,o3,0). % do we enable the switching station? -expect_p(s,o4,0). +expect_p(c,o4,0). % and we charge out pumpspeicherkraftwerk with 0KW -expect_p(s,o5,0). +expect_p(c,o5,0). -- 2.43.0