From 94df4b59ce2544ab09f1a19d3a9719733509002c Mon Sep 17 00:00:00 2001 From: someone Date: Mon, 4 Jun 2012 13:00:43 +0200 Subject: [PATCH] psh tests --- psh.test1.dl | 30 ++++++++++++++++++++++++------ psh.test2.dl | 31 +++++++++++++++++++++++++++++++ psh.test3.dl | 31 +++++++++++++++++++++++++++++++ psh.test4.dl | 31 +++++++++++++++++++++++++++++++ psh.test5.dl | 31 +++++++++++++++++++++++++++++++ 5 files changed, 148 insertions(+), 6 deletions(-) diff --git a/psh.test1.dl b/psh.test1.dl index a3df144..ed03e9f 100644 --- a/psh.test1.dl +++ b/psh.test1.dl @@ -1,23 +1,41 @@ -% testing a pumpspeicherkraftwerk +% testing a pumpspeicherkraftwerk: discharge storage_plant(psh). % define max capacity c_max(psh,20). +% define max charging power +charge_max(psh,30). + % define control i1 to 5KW (we request 5 KW) c(psh,i1,5). -% define control iw to 10 windspeed -c(psh,iw,10). +% define control i2 to 0KW (we are not getting energy to store) +c(psh,i2,0). + +% define control is to full +c(psh,is,full). % we test. % expecting i1 to be 5 expect_c(psh,i1,5). -% expecting iw to be 10 -expect_c(psh,iw,10). +% expecting i2 to be 0 +expect_c(psh,i2,0). + +% expecting is to be full +expect_c(psh,is,full). -% and therefore we shall produce 10KW +% and therefore we shall produce 5KW expect_p(psh,op,5). + + + + + +%component +%not_empty(C) :- storage_plant(C), c(C,is,full) v c(C,is,half_full). +%not_full(C) :- storage_plant(C), c(C,is,empty) v c(C,is,half_full). + diff --git a/psh.test2.dl b/psh.test2.dl index e69de29..964c6bb 100644 --- a/psh.test2.dl +++ b/psh.test2.dl @@ -0,0 +1,31 @@ +% testing a pumpspeicherkraftwerk: discharge but empty +storage_plant(psh). + +% define max capacity +c_max(psh,20). + +% define max charging power +charge_max(psh,30). + +% define control i1 to 5KW (we request 5 KW) +c(psh,i1,5). + +% define control i2 to 0KW (we are not getting energy to store) +c(psh,i2,0). + +% define control is to empty +c(psh,is,empty). + +% we test. +% expecting i1 to be 5 +expect_c(psh,i1,5). + +% expecting i2 to be 0 +expect_c(psh,i2,0). + +% expecting is to be empty +expect_c(psh,is,empty). + +% and therefore we shall produce 0KW +expect_p(psh,op,0). + diff --git a/psh.test3.dl b/psh.test3.dl index e69de29..73f9624 100644 --- a/psh.test3.dl +++ b/psh.test3.dl @@ -0,0 +1,31 @@ +% testing a pumpspeicherkraftwerk: charge +storage_plant(psh). + +% define max capacity +c_max(psh,20). + +% define max charging power +charge_max(psh,30). + +% define control i1 to charge +c(psh,i1,charge). + +% define control i2 to 10KW (we are storing 10 KW) +c(psh,i2,10). + +% define control is to empty +c(psh,is,empty). + +% we test. +% expecting i1 to be charge +expect_c(psh,i1,charge). + +% expecting i2 to be 10 +expect_c(psh,i2,10). + +% expecting is to be empty +expect_c(psh,is,empty). + +% and therefore we shall produce 0KW +expect_p(psh,op,0). + diff --git a/psh.test4.dl b/psh.test4.dl index e69de29..f030a61 100644 --- a/psh.test4.dl +++ b/psh.test4.dl @@ -0,0 +1,31 @@ +% testing a pumpspeicherkraftwerk: charge but full +storage_plant(psh). + +% define max capacity +c_max(psh,20). + +% define max charging power +charge_max(psh,30). + +% define control i1 to charge +c(psh,i1,charge). + +% define control i2 to 10KW (we are storing 10 KW) +c(psh,i2,10). + +% define control is to full +c(psh,is,full). + +% we test. +% expecting i1 to be charge +expect_c(psh,i1,charge). + +% expecting i2 to be 10 +expect_c(psh,i2,10). + +% expecting is to be full +expect_c(psh,is,full). + +% and therefore we shall return 10KW +expect_p(psh,op,10). + diff --git a/psh.test5.dl b/psh.test5.dl index e69de29..fdcf008 100644 --- a/psh.test5.dl +++ b/psh.test5.dl @@ -0,0 +1,31 @@ +% testing a pumpspeicherkraftwerk: charge over max +storage_plant(psh). + +% define max capacity +c_max(psh,20). + +% define max charging power +charge_max(psh,30). + +% define control i1 to charge +c(psh,i1,charge). + +% define control i2 to 45KW (we are storing 45 KW) +c(psh,i2,45). + +% define control is to half-full +c(psh,is,half_full). + +% we test. +% expecting i1 to be charge +expect_c(psh,i1,charge). + +% expecting i2 to be 10 +expect_c(psh,i2,45). + +% expecting is to be half-full +expect_c(psh,is,half_full). + +% and therefore we shall return 15KW +expect_p(psh,op,15). + -- 2.43.0