From 8268a0e1b3e241596b695f181b9594c9c3b81ff7 Mon Sep 17 00:00:00 2001 From: someone Date: Tue, 5 Jun 2012 13:25:30 +0200 Subject: [PATCH] c + s tests --- c.test1.dl | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ c.test2.dl | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ c.test3.dl | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ c.test4.dl | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ c.test5.dl | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ c.test6.dl | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ c.test7.dl | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ s.test5.dl | 49 +++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 455 insertions(+) create mode 100644 c.test6.dl create mode 100644 c.test7.dl create mode 100644 s.test5.dl diff --git a/c.test1.dl b/c.test1.dl index e69de29..c84b363 100644 --- a/c.test1.dl +++ b/c.test1.dl @@ -0,0 +1,58 @@ +% testing a control center +% normal operation: windmill only +% In case that L cur < L demand, the control station uses plants with the following priority with respect to their maximal capacity C x with x 2 fpsh; w; fg: +% 1. windmill w, +% 2. pumped-storage hydropower plant psh, and +% 3. fossil-fuel power station f. +% The pumped-storage hydropower plant psh can only be used if its storage (indicated via the input i3) is not empty. +% The windmill w can only be used under certain circumstances; namely, when the wind speed (which is received on input i4) is between 5 and 40. + +% our plant's types +caloric_plant(f). windmill(w). storage_plant(psh). + +% our plant's max values +c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). + +control(c). + +% define control i1/L_cur to 0KW +c(s,i1,0). + +% define control i2/L_demand to 10KW +c(s,i2,10). + +% define control i3/Sstorage to half_full +c(s,i3,half_full). + +% define control i4/Swind to 10 +c(s,i4,10). + + +% test definition. +% expecting i1 to be 0 +expect_c(s,i1,0). + +% expecting i2 to be 10 +expect_c(s,i2,10). + +% expecting i3 to be half_full +expect_c(s,i3,half_full). + +% expecting i4 to be 10 +expect_c(s,i4,10). + +% and request 10KW +expect_p(s,o1,10). + +% and request 0KW +expect_p(s,o2,0). + +% and request 0KW +expect_p(s,o3,0). + +% do we enable the switching station? +expect_p(s,o4,1). + +% and we charge out pumpspeicherkraftwerk with 0KW +expect_p(s,o5,0). + diff --git a/c.test2.dl b/c.test2.dl index e69de29..d50ec8a 100644 --- a/c.test2.dl +++ b/c.test2.dl @@ -0,0 +1,58 @@ +% testing a control center +% normal operation: windmill + pumpspeicherkraftwerk +% In case that L cur < L demand, the control station uses plants with the following priority with respect to their maximal capacity C x with x 2 fpsh; w; fg: +% 1. windmill w, +% 2. pumped-storage hydropower plant psh, and +% 3. fossil-fuel power station f. +% The pumped-storage hydropower plant psh can only be used if its storage (indicated via the input i3) is not empty. +% The windmill w can only be used under certain circumstances; namely, when the wind speed (which is received on input i4) is between 5 and 40. + +% our plant's types +caloric_plant(f). windmill(w). storage_plant(psh). + +% our plant's max values +c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). + +control(c). + +% define control i1/L_cur to 0KW +c(s,i1,0). + +% define control i2/L_demand to 30KW +c(s,i2,30). + +% define control i3/Sstorage to half_full +c(s,i3,half_full). + +% define control i4/Swind to 10 +c(s,i4,10). + + +% test definition. +% expecting i1 to be 0 +expect_c(s,i1,0). + +% expecting i2 to be 10 +expect_c(s,i2,10). + +% expecting i3 to be half_full +expect_c(s,i3,half_full). + +% expecting i4 to be 10 +expect_c(s,i4,10). + +% and request 15KW +expect_p(s,o1,15). + +% and request 15KW +expect_p(s,o2,15). + +% and request 0KW +expect_p(s,o3,0). + +% do we enable the switching station? +expect_p(s,o4,1). + +% and we charge out pumpspeicherkraftwerk with 0KW +expect_p(s,o5,0). + diff --git a/c.test3.dl b/c.test3.dl index e69de29..f1218a2 100644 --- a/c.test3.dl +++ b/c.test3.dl @@ -0,0 +1,58 @@ +% testing a control center +% normal operation: windmill + pumpspeicherkraftwerk + fuel plant +% In case that L cur < L demand, the control station uses plants with the following priority with respect to their maximal capacity C x with x 2 fpsh; w; fg: +% 1. windmill w, +% 2. pumped-storage hydropower plant psh, and +% 3. fossil-fuel power station f. +% The pumped-storage hydropower plant psh can only be used if its storage (indicated via the input i3) is not empty. +% The windmill w can only be used under certain circumstances; namely, when the wind speed (which is received on input i4) is between 5 and 40. + +% our plant's types +caloric_plant(f). windmill(w). storage_plant(psh). + +% our plant's max values +c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). + +control(c). + +% define control i1/L_cur to 0KW +c(s,i1,0). + +% define control i2/L_demand to 50KW +c(s,i2,50). + +% define control i3/Sstorage to half_full +c(s,i3,half_full). + +% define control i4/Swind to 10 +c(s,i4,10). + + +% test definition. +% expecting i1 to be 0 +expect_c(s,i1,0). + +% expecting i2 to be 50 +expect_c(s,i2,50). + +% expecting i3 to be half_full +expect_c(s,i3,half_full). + +% expecting i4 to be 10 +expect_c(s,i4,10). + +% and request 15KW +expect_p(s,o1,15). + +% and request 20KW +expect_p(s,o2,20). + +% and request 15KW +expect_p(s,o3,15). + +% do we enable the switching station? +expect_p(s,o4,1). + +% and we charge out pumpspeicherkraftwerk with 0KW +expect_p(s,o5,0). + diff --git a/c.test4.dl b/c.test4.dl index e69de29..a2e453c 100644 --- a/c.test4.dl +++ b/c.test4.dl @@ -0,0 +1,58 @@ +% testing a control center +% normal operation: windfail + pumpspeicherkraftwerk + fuel plant +% In case that L cur < L demand, the control station uses plants with the following priority with respect to their maximal capacity C x with x 2 fpsh; w; fg: +% 1. windmill w, +% 2. pumped-storage hydropower plant psh, and +% 3. fossil-fuel power station f. +% The pumped-storage hydropower plant psh can only be used if its storage (indicated via the input i3) is not empty. +% The windmill w can only be used under certain circumstances; namely, when the wind speed (which is received on input i4) is between 5 and 40. + +% our plant's types +caloric_plant(f). windmill(w). storage_plant(psh). + +% our plant's max values: min + max wind hardcoded (5-40) +c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). + +control(c). + +% define control i1/L_cur to 0KW +c(s,i1,0). + +% define control i2/L_demand to 50KW +c(s,i2,50). + +% define control i3/Sstorage to half_full +c(s,i3,half_full). + +% define control i4/Swind to 50 +c(s,i4,50). + + +% test definition. +% expecting i1 to be 0 +expect_c(s,i1,0). + +% expecting i2 to be 50 +expect_c(s,i2,50). + +% expecting i3 to be half_full +expect_c(s,i3,half_full). + +% expecting i4 to be 50 +expect_c(s,i4,50). + +% and request 0KW +expect_p(s,o1,0). + +% and request 20KW +expect_p(s,o2,20). + +% and request 30KW +expect_p(s,o3,30). + +% do we enable the switching station? +expect_p(s,o4,1). + +% and we charge out pumpspeicherkraftwerk with 0KW +expect_p(s,o5,0). + diff --git a/c.test5.dl b/c.test5.dl index e69de29..d39627a 100644 --- a/c.test5.dl +++ b/c.test5.dl @@ -0,0 +1,58 @@ +% testing a control center +% normal operation: windfail + pumpspeicherkraftwerkfail + fuel plant +% In case that L cur < L demand, the control station uses plants with the following priority with respect to their maximal capacity C x with x 2 fpsh; w; fg: +% 1. windmill w, +% 2. pumped-storage hydropower plant psh, and +% 3. fossil-fuel power station f. +% The pumped-storage hydropower plant psh can only be used if its storage (indicated via the input i3) is not empty. +% The windmill w can only be used under certain circumstances; namely, when the wind speed (which is received on input i4) is between 5 and 40. + +% our plant's types +caloric_plant(f). windmill(w). storage_plant(psh). + +% our plant's max values: min + max wind hardcoded (5-40) +c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). + +control(c). + +% define control i1/L_cur to 0KW +c(s,i1,0). + +% define control i2/L_demand to 50KW +c(s,i2,50). + +% define control i3/Sstorage to empty +c(s,i3,empty). + +% define control i4/Swind to 50 +c(s,i4,50). + + +% test definition. +% expecting i1 to be 0 +expect_c(s,i1,0). + +% expecting i2 to be 50 +expect_c(s,i2,50). + +% expecting i3 to be half_full +expect_c(s,i3,empty). + +% expecting i4 to be 50 +expect_c(s,i4,50). + +% and request 0KW +expect_p(s,o1,0). + +% and request 0KW +expect_p(s,o2,0). + +% and request 50KW +expect_p(s,o3,50). + +% do we enable the switching station? +expect_p(s,o4,1). + +% and we charge out pumpspeicherkraftwerk with 0KW +expect_p(s,o5,0). + diff --git a/c.test6.dl b/c.test6.dl new file mode 100644 index 0000000..64a5e88 --- /dev/null +++ b/c.test6.dl @@ -0,0 +1,58 @@ +% testing a control center +% charge pumpspeicherkraftwerkfail +% In case that L cur < L demand, the control station uses plants with the following priority with respect to their maximal capacity C x with x 2 fpsh; w; fg: +% 1. windmill w, +% 2. pumped-storage hydropower plant psh, and +% 3. fossil-fuel power station f. +% The pumped-storage hydropower plant psh can only be used if its storage (indicated via the input i3) is not empty. +% The windmill w can only be used under certain circumstances; namely, when the wind speed (which is received on input i4) is between 5 and 40. + +% our plant's types +caloric_plant(f). windmill(w). storage_plant(psh). + +% our plant's max values: min + max wind hardcoded (5-40) +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). + +% define control i2/L_demand to 0KW +c(s,i2,10). + +% define control i3/Sstorage to empty +c(s,i3,empty). + +% define control i4/Swind to 0 +c(s,i4,0). + + +% test definition. +% expecting i1 to be 20 +expect_c(s,i1,20). + +% expecting i2 to be 10 +expect_c(s,i2,10). + +% expecting i3 to be empty +expect_c(s,i3,empty). + +% expecting i4 to be 0 +expect_c(s,i4,0). + +% and request 0KW +expect_p(s,o1,0). + +% and request 0KW +expect_p(s,o2,0). + +% and request 0KW +expect_p(s,o3,0). + +% do we enable the switching station? +expect_p(s,o4,2). + +% and we charge out pumpspeicherkraftwerk with 10KW +expect_p(s,o5,10). + diff --git a/c.test7.dl b/c.test7.dl new file mode 100644 index 0000000..2316c77 --- /dev/null +++ b/c.test7.dl @@ -0,0 +1,58 @@ +% testing a control center +% noop +% In case that L cur < L demand, the control station uses plants with the following priority with respect to their maximal capacity C x with x 2 fpsh; w; fg: +% 1. windmill w, +% 2. pumped-storage hydropower plant psh, and +% 3. fossil-fuel power station f. +% The pumped-storage hydropower plant psh can only be used if its storage (indicated via the input i3) is not empty. +% The windmill w can only be used under certain circumstances; namely, when the wind speed (which is received on input i4) is between 5 and 40. + +% our plant's types +caloric_plant(f). windmill(w). storage_plant(psh). + +% our plant's max values: min + max wind hardcoded (5-40) +c_max(f,60). c_max(w,15). c_max(psh,20). charge_max(psh,30). + +control(c). + +% define control i1/L_cur to 0KW +c(s,i1,0). + +% define control i2/L_demand to 0KW +c(s,i2,0). + +% define control i3/Sstorage to empty +c(s,i3,empty). + +% define control i4/Swind to 0 +c(s,i4,0). + + +% test definition. +% expecting i1 to be 0 +expect_c(s,i1,0). + +% expecting i2 to be 0 +expect_c(s,i2,0). + +% expecting i3 to be empty +expect_c(s,i3,empty). + +% expecting i4 to be 0 +expect_c(s,i4,0). + +% and request 0KW +expect_p(s,o1,0). + +% and request 0KW +expect_p(s,o2,0). + +% and request 0KW +expect_p(s,o3,0). + +% do we enable the switching station? +expect_p(s,o4,0). + +% and we charge out pumpspeicherkraftwerk with 0KW +expect_p(s,o5,0). + diff --git a/s.test5.dl b/s.test5.dl new file mode 100644 index 0000000..77b4cef --- /dev/null +++ b/s.test5.dl @@ -0,0 +1,49 @@ +% testing a switching center +% system accumilation mode: another test +% In case i4 = 1, the system accumulates all incoming energy from the plants (i1, i2, and i3) and from i6 and assigns the sum to o2. Again, o1 = 0 as the pumped-storage hydropower plant psh should not receive energy. + +switching(s). + +% define control i1 to 10KW +c(s,i1,10). + +% define control i2 to 10KW +c(s,i2,10). + +% define control i3 to 10KW +c(s,i3,10). + +% define control i4 to 1 +c(s,i4,1). + +% define control i5 to 0KW +c(s,i5,0). + +% define control i6 to 10KW +c(s,i6,10). + +% test definition. +% expecting i1 to be 10 +expect_c(s,i1,10). + +% expecting i2 to be 10 +expect_c(s,i2,10). + +% expecting i3 to be 10 +expect_c(s,i3,10). + +% expecting i4 to be 1 +expect_c(s,i4,1). + +% expecting i5 to be 0 +expect_c(s,i5,0). + +% expecting i6 to be 10 +expect_c(s,i6,10). + +% and therefore we shall charge with 0KW +expect_p(s,o1,0). + +% and return 70KW +expect_p(s,o2,40). + -- 2.43.0