Skip to content

Commit 963b6c8

Browse files
committed
Make ShiftingMatryoshka the default power manager algorithm
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 2ab7616 commit 963b6c8

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/frequenz/sdk/microgrid/_power_managing/_power_managing_actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__( # pylint: disable=too-many-arguments
4343
component_type: ComponentType | None = None,
4444
# arguments to actors need to serializable, so we pass an enum for the algorithm
4545
# instead of an instance of the algorithm.
46-
algorithm: Algorithm = Algorithm.MATRYOSHKA,
46+
algorithm: Algorithm = Algorithm.SHIFTING_MATRYOSHKA,
4747
):
4848
"""Create a new instance of the power manager.
4949

tests/timeseries/_battery_pool/test_battery_pool_control_methods.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ async def test_case_3(self, mocks: Mocks, mocker: MockerFixture) -> None:
379379
await bounds_1_rx.receive(), power=-1000.0, lower=-4000.0, upper=4000.0
380380
)
381381
self._assert_report(
382-
await bounds_2_rx.receive(), power=-1000.0, lower=-1000.0, upper=0.0
382+
await bounds_2_rx.receive(), power=-1000.0, lower=0.0, upper=1000.0
383383
)
384384
await asyncio.sleep(0.0) # Wait for the power to be distributed.
385385
assert set_power.call_count == 4
@@ -390,20 +390,21 @@ async def test_case_3(self, mocks: Mocks, mocker: MockerFixture) -> None:
390390
set_power.reset_mock()
391391

392392
await battery_pool_2.propose_power(
393-
Power.from_watts(0.0),
393+
Power.from_watts(200.0),
394394
bounds=timeseries.Bounds(Power.from_watts(0.0), Power.from_watts(1000.0)),
395395
)
396396
self._assert_report(
397-
await bounds_1_rx.receive(), power=0.0, lower=-4000.0, upper=4000.0
397+
await bounds_1_rx.receive(), power=-800.0, lower=-4000.0, upper=4000.0
398398
)
399399
bounds = await bounds_2_rx.receive()
400400
if not latest_dist_result_2.has_value():
401401
bounds = await bounds_2_rx.receive()
402-
self._assert_report(bounds, power=0.0, lower=-1000.0, upper=0.0)
402+
self._assert_report(bounds, power=-800.0, lower=0.0, upper=1000.0)
403403
await asyncio.sleep(0.0) # Wait for the power to be distributed.
404404
assert set_power.call_count == 4
405405
assert sorted(set_power.call_args_list) == [
406-
mocker.call(inv_id, 0.0) for inv_id in mocks.microgrid.battery_inverter_ids
406+
mocker.call(inv_id, -200.0)
407+
for inv_id in mocks.microgrid.battery_inverter_ids
407408
]
408409

409410
async def test_case_4(self, mocks: Mocks, mocker: MockerFixture) -> None:

0 commit comments

Comments
 (0)