1 % pumpspeicherkraftwerk definition.
3 % if i1 > 0 and not empty produce / reditect i2.
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).
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).
13 p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,0), c(C,i2,0), OP = 0, #int(OP).
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).
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).
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).
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).
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).
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.