You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When forwardLogging is enabled (seems to be default), there seems to be a mixup with commodities across phases that can cause a crash. I turned this crash in to a warning by checking if the commodity is planned or realized, e.g.:
@@ -137,14 +137,17 @@ class DevCtrl(OptCtrl):
if self.forwardLogging and self.host.logControllers:
for c in signal.commodities:
for i in range(0, signal.planHorizon):
- self.logValue("W-power.plan.real.c."+c, self.plan[c][int(signal.time + i*signal.timeBase)].real, int(signal.time + i*signal.timeBase))
- if self.host.extendedLogging:
- self.logValue("W-power.plan.imag.c." + c, self.plan[c][int(signal.time + i*signal.timeBase)].imag, int(signal.time + i * signal.timeBase))
+ if c in self.plan:
+ self.logValue("W-power.plan.real.c."+c, self.plan[c][int(signal.time + i*signal.timeBase)].real, int(signal.time + i*signal.timeBase))
+ if self.host.extendedLogging:
+ self.logValue("W-power.plan.imag.c." + c, self.plan[c][int(signal.time + i*signal.timeBase)].imag, int(signal.time + i * signal.timeBase))
+ else:
+ self.logWarning("W-power.plan.%s, unavailable for %s"%(c, self.name))
- if self.useEventControl:
- self.logValue("W-power.realized.imag.c." + c,self.realized[c][int(signal.time + i * signal.timeBase)].imag,int(signal.time + i * signal.timeBase))
+ if self.useEventControl and c in self.realized:
+ self.logValue("W-power.realized.real.c." + c,self.realized[c][int(signal.time + i * signal.timeBase)].real,int(signal.time + i * signal.timeBase))
if self.host.extendedLogging:
- self.logValue("W-power.realized.real.c." + c,self.realized[c][int(signal.time + i * signal.timeBase)].real,int(signal.time + i * signal.timeBase))
+ self.logValue("W-power.realized.imag.c." + c,self.realized[c][int(signal.time + i * signal.timeBase)].imag,int(signal.time + i * signal.timeBase))
self.lockPlanning.release()
return dict(self.realized)
15:35:25 | WARNING: [LOADCTRL_L1] W-power.plan.EL2, unavailable for LOADCTRL_L1
15:35:27 | WARNING: [LOADCTRL_L1] W-power.plan.EL3, unavailable for LOADCTRL_L1
15:35:27 | WARNING: [LOADCTRL_L2] W-power.plan.EL1, unavailable for LOADCTRL_L2
15:35:27 | WARNING: [LOADCTRL_L2] W-power.plan.EL3, unavailable for LOADCTRL_L2
15:35:27 | WARNING: [LOADCTRL_L3] W-power.plan.EL1, unavailable for LOADCTRL_L3
15:35:27 | WARNING: [LOADCTRL_L3] W-power.plan.EL2, unavailable for LOADCTRL_L3
15:35:27 | WARNING: [PVCTRL_3P_L1] W-power.plan.EL2, unavailable for PVCTRL_3P_L1
15:35:27 | WARNING: [PVCTRL_3P_L1] W-power.plan.EL3, unavailable for PVCTRL_3P_L1
15:35:27 | WARNING: [PVCTRL_3P_L2] W-power.plan.EL1, unavailable for PVCTRL_3P_L2
15:35:27 | WARNING: [PVCTRL_3P_L2] W-power.plan.EL3, unavailable for PVCTRL_3P_L2
...
Furthermore, there seems to be a mixup for real and imaginary logging in the end of the code above and lower down in the same file:
@@ -239,9 +242,9 @@ class DevCtrl(OptCtrl):
self.realized[c][t] = plan[c][i]
if self.forwardLogging:
- self.logValue("W-power.realized.imag.c." + c,self.realized[c][t].real,t)
+ self.logValue("W-power.realized.real.c." + c,self.realized[c][t].real,t)
if self.host.extendedLogging:
- self.logValue("W-power.realized.real.c." + c,self.realized[c][t].imag,t)
+ self.logValue("W-power.realized.imag.c." + c,self.realized[c][t].imag,t)
Kind regards,
Dennis
The text was updated successfully, but these errors were encountered:
When forwardLogging is enabled (seems to be default), there seems to be a mixup with commodities across phases that can cause a crash. I turned this crash in to a warning by checking if the commodity is planned or realized, e.g.:
15:35:25 | WARNING: [LOADCTRL_L1] W-power.plan.EL2, unavailable for LOADCTRL_L1
15:35:27 | WARNING: [LOADCTRL_L1] W-power.plan.EL3, unavailable for LOADCTRL_L1
15:35:27 | WARNING: [LOADCTRL_L2] W-power.plan.EL1, unavailable for LOADCTRL_L2
15:35:27 | WARNING: [LOADCTRL_L2] W-power.plan.EL3, unavailable for LOADCTRL_L2
15:35:27 | WARNING: [LOADCTRL_L3] W-power.plan.EL1, unavailable for LOADCTRL_L3
15:35:27 | WARNING: [LOADCTRL_L3] W-power.plan.EL2, unavailable for LOADCTRL_L3
15:35:27 | WARNING: [PVCTRL_3P_L1] W-power.plan.EL2, unavailable for PVCTRL_3P_L1
15:35:27 | WARNING: [PVCTRL_3P_L1] W-power.plan.EL3, unavailable for PVCTRL_3P_L1
15:35:27 | WARNING: [PVCTRL_3P_L2] W-power.plan.EL1, unavailable for PVCTRL_3P_L2
15:35:27 | WARNING: [PVCTRL_3P_L2] W-power.plan.EL3, unavailable for PVCTRL_3P_L2
...
Furthermore, there seems to be a mixup for real and imaginary logging in the end of the code above and lower down in the same file:
Kind regards,
Dennis
The text was updated successfully, but these errors were encountered: