From c61db9e780bb72007feff766adaa614e9beb45c6 Mon Sep 17 00:00:00 2001 From: someone Date: Tue, 5 Jun 2012 03:01:26 +0200 Subject: [PATCH] switching done. --- s.dl | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/s.dl b/s.dl index 9c3a7ba..2c97771 100644 --- a/s.dl +++ b/s.dl @@ -9,27 +9,10 @@ p(C,o1,OP) :- not ab(C), switching(C), c(C,i4,1), c(C,i1,I1), c(C,i2,I2), c(C,i3 p(C,o2,OP) :- not ab(C), switching(C), c(C,i4,1), c(C,i1,I1), c(C,i2,I2), c(C,i3,I3), c(C,i6,I6), T1 = I1 + I2, T2 = I3 + I6, OP = T1 + T2, #int(OP). % system charge mode -%p(C,o1,O1) :- not ab(C), switching(C), c(C,i4,2), c(C,i1,I1), c(C,i2,I2), c(C,i3,I3), c(C,i5,I5), c(C,i6,I6), O1 = 0, #int(O1). +p(C,o1,OP) :- not ab(C), switching(C), c(C,i4,2), c(C,i5,I5), c(C,i6,I6), I6 >= I5, OP = I5, #int(OP). +p(C,o2,OP) :- not ab(C), switching(C), c(C,i4,2), c(C,i5,I5), c(C,i6,I6), I6 >= I5, OP = I6 - I5, #int(OP). - - -% over MAX discharge -% not charge but powered charger input -%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). - -% noop -%p(C,op,OP) :- not ab(C), storage_plant(C), c(C,i1,0), c(C,i2,0), OP = 0, #int(OP). - -% charge but full -%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). - -% over MAX charge -%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). - -% charge -%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). - -% normal discharge but empty -% not charge but powered charger input -%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). +% system charge mode over MAX +p(C,o1,OP) :- not ab(C), switching(C), c(C,i4,2), c(C,i5,I5), c(C,i6,I6), I6 < I5, OP = I6, #int(OP). +p(C,o2,OP) :- not ab(C), switching(C), c(C,i4,2), c(C,i5,I5), c(C,i6,I6), I6 < I5, OP = 0, #int(OP). -- 2.43.0