1 % switching definition.
4 p(C,o1,O1) :- not ab(C), switching(C), c(C,i4,0), c(C,i6,I6), O1 = 0, O2 = I6, #int(O1), #int(O2).
5 p(C,o2,O2) :- not ab(C), switching(C), c(C,i4,0), c(C,i6,I6), O1 = 0, O2 = I6, #int(O1), #int(O2).
8 % not charge but powered charger input
9 %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).
12 %p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,0), c(C,i2,0), OP = 0, #int(OP).
15 %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).
18 %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).
21 %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 % normal discharge but empty
24 % not charge but powered charger input
25 %p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i2,I2), c(C,is,empty), not c(C,i1,charge), OP = I2, #int(OP).