Feat: Support shared storage (multi‑feed stock)#2001
Feat: Support shared storage (multi‑feed stock)#2001Ahmad-Wahid wants to merge 9 commits intofeat/multi-commodityfrom
Conversation
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
…multi-feed-stock # Conflicts: # flexmeasures/data/models/planning/tests/test_commitments.py
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
|
In the test case, we are scheduling |
|
Currently, the docstring is not expected as the results we have. I will update it once I understand the issue. |
|
Just from reading the PR description (very helpful, thank you) and your comments, I had the idea to use the
So, for instance: flex_model = [
{"sensor": s1.id, "state-of-charge": soc_sensor.id},
{"sensor": s2.id, "state-of-charge": soc_sensor.id},
{"sensor": soc_sensor.id, "soc-at-start": 20, "soc-max": 140},
]For discussion. Now I'll read the code. |
|
|
||
| def test_two_devices_shared_stock(app, db): | ||
| """ | ||
| Test scheduling two batteries sharing a single shared stock. |
There was a problem hiding this comment.
The concept of two batteries sharing a single shared stock is lost on me. I would describe the battery itself as representing the stock, and then having two feeders connected to it, for instance a treadmill and a bicycle trainer, which can both charge the battery.
| schedules = scheduler.compute(skip_validation=True) | ||
|
|
||
| # Extract schedules by type | ||
| storage_schedules = [ |
There was a problem hiding this comment.
The term "storage schedule", which is also used in the StorageScheduler, has become misleading at this point (of our years-long development). Maybe "feeder schedule" is more appropriate. Although that would only fit devices that increase the SoC. Maybe "actuator schedule" or "flow schedule".
In any case, we should make a clearer distinction now between:
- the flow schedule (currently still named
storage_schedulein the code) - the stock schedule (currently still named
soc_schedulein the code)
Description
This PR adds support for shared storage stocks in the
StorageScheduler.Multiple devices can now reference the same storage by specifying a
stock-idin their flex‑model. Devices with the samestock-idshare a single state-of-charge (SOC) trajectory.If
stock-idis not provided, the scheduler behaves exactly as before (each device has its own SOC).Example
Both devices now charge/discharge the same storage.
Todos:
How to test
Expected:
storage_schedulesstate_of_chargescheduleRelated Items
Sign-off