]> git.somenet.org - pub/jan/ewbs-dlv.git/blob - psh.dl
psh updates
[pub/jan/ewbs-dlv.git] / psh.dl
1 % pumpspeicherkraftwerk definition.
2
3 % if i1 > 0 and not empty produce / reditect i2.
4 % normal discharge
5 % not charge but powered charger input
6 p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,I1), c(C,i2,I2), not c(C,is,empty), not c(C,i1,charge), c_max(C,MAX), I1 > 0, MAX >= I1, OP = I1 + I2, #int(OP).
7
8 % over MAX discharge
9 % not charge but powered charger input
10 p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,I1), c(C,i2,I2), not c(C,is,empty), not c(C,i1,charge), c_max(C,MAX), I1 > MAX, OP = MAX + I2, #int(OP).
11
12 % noop
13 p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,0), c(C,i2,0), OP = 0, #int(OP).
14
15 % charge but full
16 p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,charge), c(C,i2,I2), c(C,is,full), OP = I2, #int(OP).
17
18 % over MAX charge
19 p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,charge), c(C,i2,I2), charge_max(C,CMAX), not c(C,is,full), I2 > CMAX, OP = I2 - CMAX, #int(OP).
20
21 % charge
22 p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,charge), c(C,i2,I2), charge_max(C,CMAX), not c(C,is,full), I2 <= CMAX, OP = 0, #int(OP).
23
24
25
26 %p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,0), c(C,i2,I2),OP = I2, #int(OP).
27 %p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,I1), c(C,i2,I2),c_max(C,MAX), I1 > 0, MAX >= I1, OP = I1 + I2, #int(OP).
28
29 %psh_empty(C) :- storage_plant(C), -c(C,is,full), -c(C,is,half_full).
30 %psh_not_full(C) :- storage_plant(C), c(C,is,empty) | c(C,is,half_full).
31
32 %p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,I1), c(C,i2,I2),OP = I1 + I2.
33 %p(C,op,OP) :- not ab(C), storage_plant(C), c(C,iw,IW), IW > 40, OP = 0.
34 %p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,I1), psh_empty(C), I1 == 0, OP = 0.
35
36
37