]> git.somenet.org - pub/jan/ewbs-dlv.git/blob - s.test3.dl
GITOLITE.txt
[pub/jan/ewbs-dlv.git] / s.test3.dl
1 % testing a switching center
2 % system charge mode
3 % In case i4 = 2, the system should store power in the hydropower plant psh with the energy mains supply. Therefore, 01 = i5 and o2 = i6 - i5. This is of course only possible if i6 >= i5; if this is not the case, it redirects as much energy as available to the storage plant, so o1 = i6 and o2 = 0.
4
5 switching(s).
6
7 % define control i1 to 1KW
8 p(s,i1,1).
9
10 % define control i2 to 2KW
11 p(s,i2,2).
12
13 % define control i3 to 3KW
14 p(s,i3,3).
15
16 % define control i4 to 2
17 c(s,i4,2).
18
19 % define control i5 to 5KW
20 c(s,i5,5).
21
22 % define control i6 to 10KW
23 p(s,i6,10).
24
25 % test definition.
26 % expecting i1 to be 1
27 expect_p(s,i1,1).
28
29 % expecting i2 to be 2
30 expect_p(s,i2,2).
31
32 % expecting i3 to be 3
33 expect_p(s,i3,3).
34
35 % expecting i4 to be 2
36 expect_c(s,i4,2).
37
38 % expecting i5 to be 5
39 expect_c(s,i5,5).
40
41 % expecting i6 to be 10
42 expect_p(s,i6,10).
43
44 % and therefore we shall charge with 5KW
45 expect_p(s,o1,5).
46
47 % and return 5KW
48 expect_p(s,o2,5).
49