Skip to content

Commit

Permalink
Issue #203: Log warning for incompatible initial battery charge
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzzoQM committed Oct 4, 2024
1 parent 8c6f2f9 commit 73fe805
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bsk_rl/sim/dyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,10 @@ def setup_battery(
self.powerMonitor = simpleBattery.SimpleBattery()
self.powerMonitor.ModelTag = "powerMonitor"
self.powerMonitor.storageCapacity = batteryStorageCapacity
if storedCharge_Init > batteryStorageCapacity or storedCharge_Init < 0:
self.logger.warning(
f"Battery initial charge {storedCharge_Init} incompatible with its capacity {batteryStorageCapacity}."
)
self.powerMonitor.storedCharge_Init = storedCharge_Init
self.powerMonitor.addPowerNodeToModel(self.solarPanel.nodePowerOutMsg)
self.simulator.AddModelToTask(
Expand Down

0 comments on commit 73fe805

Please sign in to comment.