Conversation
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
There was a problem hiding this comment.
Looks good. Seems to me this should work for a first version. There are some important differences with the original implementation. Two that quickly occur to me are: you allow None values is the profile list, and when checking for compatibility you only look at the time step duration and not the start time. This gives more flexibility but also enlarges the chance for bugs. Just something to consider.
| if self.cost_improvement_value is None: | ||
| self.cost_improvement_value = self.get_cost( | ||
| self.old_plan, self.global_diff_target | ||
| ) - self.get_cost(self.proposed_plan, self.global_diff_target) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Apparently it is. Sorry for bringing it up.
There was a problem hiding this comment.
Price target not yet implemented but I guess that's deliberately?
There was a problem hiding this comment.
Just as a suggestion: abstract base classes can be used here.
jorritn
left a comment
There was a problem hiding this comment.
Awesome work! Most of the porting has been done. After porting S2FrbcDeviceStateWrapper and the ProfileMetadata (or something equivalent), you should be good to run a test on find_best_plan(). The DevicePlan class doesn't have to be ported for that.
There was a problem hiding this comment.
Is a duplicate with s2-frbc_device_planner. This can be removed, also because the device_controller is a different component in the architecture.
There was a problem hiding this comment.
Why not extend the DevicePlanner class?
There was a problem hiding this comment.
Apart from that. Looks very good!
| return self.latest_plan.get_energy() | ||
|
|
||
| def accept_proposal(self, accepted_proposal): | ||
| if accepted_proposal.get_origin() != self: |
There was a problem hiding this comment.
origin needs to be added to the proposal class
| if self.cost_improvement_value is None: | ||
| self.cost_improvement_value = self.get_cost( | ||
| self.old_plan, self.global_diff_target | ||
| ) - self.get_cost(self.proposed_plan, self.global_diff_target) |
There was a problem hiding this comment.
Apparently it is. Sorry for bringing it up.
There was a problem hiding this comment.
I would need some extra time to dive thoroughly into this but it looks good at first sight.
There was a problem hiding this comment.
The other classes had type hints. Would be good to add it here too.
There was a problem hiding this comment.
If guess this needs some extension later. If I understand it correct, the storageStatus should be included, for example.
| for frbc_state in final_states: | ||
| frbc_state.generate_next_timestep_states(next_timestep) | ||
| end_state = self.find_best_end_state( | ||
| last_timestep.get_final_states_within_fill_level_target() |
There was a problem hiding this comment.
Does this include the emergency state? If yes, then it's fine.
| S2FrbcDeviceStateWrapper.get_leakage_rate(self.timestep, self.fill_level) | ||
| * seconds | ||
| ) | ||
| self.fill_level += self.timestep.get_forecasted_usage() |
There was a problem hiding this comment.
I am not 100% sure whether this should be a plus or a minus. The original implementation has plus as well but intuitively I would think it should be a minus.
There was a problem hiding this comment.
Intuition was right: the protocol spec says: A positive value indicates that the fill level will decrease due to usage. https://github.com/flexiblepower/s2-ws-json/blob/b831b6f1f19f824f32269ecd6ac6a6e250e7af80/s2-asyncapi/s2-cem.yaml#L599C131-L599C205
There was a problem hiding this comment.
In response to your TODO: conceptually is the same as the FRBCUsageForecast. The utility function from_storage_usage_profile converts it from an S2 data object into an array.
…a couple of wrappers Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
…rrors Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
… a target as input Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
… added Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
Signed-off-by: Vlad Iftime <vladiftime60@gmail.com>
This reverts commit f0e31b4.
* refactor: collect parameters Signed-off-by: F.N. Claessen <felix@seita.nl> * refactor: get rid of UUID actuator_id (prefer str instead) Signed-off-by: F.N. Claessen <felix@seita.nl> * delete: remove empty results file Signed-off-by: F.N. Claessen <felix@seita.nl> * docs: add instructions for profiling Signed-off-by: F.N. Claessen <felix@seita.nl> * refactor: get rid of UUID operation_mode_is (prefer str instead) Signed-off-by: F.N. Claessen <felix@seita.nl> --------- Signed-off-by: F.N. Claessen <felix@seita.nl>
This is a big PR. So, I suggest a collaborative review.