diff --git a/Utilities/BESS.py b/Utilities/BESS.py index 8fd4bc2..76ffb35 100644 --- a/Utilities/BESS.py +++ b/Utilities/BESS.py @@ -92,8 +92,13 @@ def update_cycle_SoC(bess_data, bess_soc_for_cycle, timestamps): axis=0, ) + def arrange_swap(bess_data, c): 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% - \ No newline at end of file + 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