diff --git a/flexmeasures_s2/profile_steering/device_planner/nocontrol/__init__.py b/flexmeasures_s2/profile_steering/device_planner/nocontrol/__init__.py index e69de29..42bd487 100644 --- a/flexmeasures_s2/profile_steering/device_planner/nocontrol/__init__.py +++ b/flexmeasures_s2/profile_steering/device_planner/nocontrol/__init__.py @@ -0,0 +1,19 @@ +from flexmeasures_s2.profile_steering.device_planner.nocontrol.s2_nocontrol_device_state import ( + S2NoControlDeviceState, +) +from flexmeasures_s2.profile_steering.device_planner.nocontrol.s2_nocontrol_device_planner import ( + S2NoControlDevicePlanner, +) +from flexmeasures_s2.profile_steering.device_planner.nocontrol.s2_nocontrol_plan import ( + S2NoControlPlan, +) +from flexmeasures_s2.profile_steering.device_planner.nocontrol.proposal_without_improvement import ( + ProposalWithoutImprovement, +) + +__all__ = [ + "S2NoControlDeviceState", + "S2NoControlDevicePlanner", + "S2NoControlPlan", + "ProposalWithoutImprovement", +] diff --git a/flexmeasures_s2/profile_steering/planning_service_impl.py b/flexmeasures_s2/profile_steering/planning_service_impl.py index 64ab788..5c35318 100644 --- a/flexmeasures_s2/profile_steering/planning_service_impl.py +++ b/flexmeasures_s2/profile_steering/planning_service_impl.py @@ -28,6 +28,12 @@ from flexmeasures_s2.profile_steering.device_planner.frbc.s2_frbc_device_state import ( S2FrbcDeviceState, ) +from flexmeasures_s2.profile_steering.device_planner.nocontrol.s2_nocontrol_device_planner import ( + S2NoControlDevicePlanner, +) +from flexmeasures_s2.profile_steering.device_planner.nocontrol.s2_nocontrol_device_state import ( + S2NoControlDeviceState, +) # Logger setup import logging @@ -174,6 +180,15 @@ def create_controller_tree( congestion_point, ) ) + elif isinstance(device_state, S2NoControlDeviceState): + logger.debug("S2 NoControl planner created!") + cpc.add_device_controller( + S2NoControlDevicePlanner( + device_state, + target.metadata, + congestion_point, + ) + ) # Add other device types here as needed else: logger.warning( diff --git a/flexmeasures_s2/scheduler/schedulers.py b/flexmeasures_s2/scheduler/schedulers.py index eab8370..a2e8bc7 100644 --- a/flexmeasures_s2/scheduler/schedulers.py +++ b/flexmeasures_s2/scheduler/schedulers.py @@ -24,6 +24,12 @@ from flexmeasures_s2.profile_steering.device_planner.frbc.s2_frbc_device_state import ( S2FrbcDeviceState, ) +from flexmeasures_s2.profile_steering.device_planner.nocontrol.s2_nocontrol_device_planner import ( + S2NoControlDevicePlanner, +) +from flexmeasures_s2.profile_steering.device_planner.nocontrol.s2_nocontrol_device_state import ( + S2NoControlDeviceState, +) # NoControl planner is on a different branch # from flexmeasures_s2.profile_steering.device_planner.nocontrol.s2_nocontrol_device_planner import ( diff --git a/flexmeasures_s2/scheduler/tests/test_frbc.py b/flexmeasures_s2/scheduler/tests/test_frbc.py deleted file mode 100644 index a04952d..0000000 --- a/flexmeasures_s2/scheduler/tests/test_frbc.py +++ /dev/null @@ -1,24 +0,0 @@ -import pandas as pd - -from flexmeasures_s2.scheduler.schedulers import S2Scheduler - - -def get_JouleProfileTarget(): - """Simple test helper function to create a target profile for testing.""" - # TODO: Implement proper target profile creation - return {"test": "target"} - - -def test_s2_frbc_scheduler(setup_frbc_asset): - scheduler = S2Scheduler( - setup_frbc_asset, - start=pd.Timestamp("2025-01-20T13:00+01"), - end=pd.Timestamp("2025-01-20T19:00+01"), - resolution=pd.Timedelta("PT1H"), - flex_model={}, # S2Scheduler fetches this from asset attributes - flex_context={ - "target-profile": get_JouleProfileTarget(), # todo: port target profile from Java test - }, - ) - results = scheduler.compute() - assert results == "todo: check for expected results"