bess swap logic wip (not started)

This commit is contained in:
Lucas Tan 2025-07-19 16:21:37 +01:00
parent ee8d0125bc
commit 7590aa6b58

View File

@ -92,8 +92,13 @@ def update_cycle_SoC(bess_data, bess_soc_for_cycle, timestamps):
axis=0, axis=0,
) )
def arrange_swap(bess_data, c): def arrange_swap(bess_data, c):
for unit in bess_data["units"]: for unit in bess_data["units"]:
if unit["SoC"] < c["bess"]["buffer"]: if unit["SoC"] < c["bess"]["buffer"]:
# find for unassigned BESS unit with SOC at 100% # find for unassigned BESS unit with SOC at 100%
for candidate in bess_data["units"]:
if candidate["SoC"] == 1 and candidate["site"] == "Unassigned":
# assign the candidate to the site
candidate["site"] = unit["site"]
break