File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
tests/actor/_power_managing Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,12 @@ class Proposal:
207207 priority : int
208208 """The priority of the actor sending the proposal."""
209209
210+ creation_time : float
211+ """The loop time when the proposal is created.
212+
213+ This is used by the power manager to determine the age of the proposal.
214+ """
215+
210216 request_timeout : datetime .timedelta = datetime .timedelta (seconds = 5.0 )
211217 """The maximum amount of time to wait for the request to be fulfilled."""
212218
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ async def propose_power(
132132 bounds = bounds ,
133133 component_ids = self ._battery_pool ._batteries ,
134134 priority = self ._priority ,
135+ creation_time = asyncio .get_running_loop ().time (),
135136 request_timeout = request_timeout ,
136137 )
137138 )
@@ -177,6 +178,7 @@ async def propose_charge(
177178 bounds = timeseries .Bounds (None , None ),
178179 component_ids = self ._battery_pool ._batteries ,
179180 priority = self ._priority ,
181+ creation_time = asyncio .get_running_loop ().time (),
180182 request_timeout = request_timeout ,
181183 )
182184 )
@@ -222,6 +224,7 @@ async def propose_discharge(
222224 bounds = timeseries .Bounds (None , None ),
223225 component_ids = self ._battery_pool ._batteries ,
224226 priority = self ._priority ,
227+ creation_time = asyncio .get_running_loop ().time (),
225228 request_timeout = request_timeout ,
226229 )
227230 )
Original file line number Diff line number Diff line change 33
44"""Tests for the Matryoshka power manager algorithm."""
55
6+ import asyncio
67from datetime import datetime , timezone
78
89from frequenz .sdk import timeseries
@@ -46,6 +47,7 @@ def tgt_power( # pylint: disable=too-many-arguments
4647 None if bounds [1 ] is None else Power .from_watts (bounds [1 ]),
4748 ),
4849 priority = priority ,
50+ creation_time = asyncio .get_event_loop ().time (),
4951 ),
5052 self ._system_bounds ,
5153 must_send ,
You can’t perform that action at this time.
0 commit comments