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), p(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), p(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), p(C,i2,0), OP = 0, #int(OP).
16 p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,charge), p(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), p(C,i2,I2), w_charge(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), p(C,i2,I2), w_charge(CMAX), not c(C,is,full), I2 <= CMAX, OP = 0, #int(OP).
24 % normal discharge but empty
25 % not charge but powered charger input
26 p(C,op,OP) :- not ab(C), storage_plant(C), p(C,i2,I2), c(C,is,empty), not c(C,i1,charge), OP = I2, #int(OP).