commonpower.control.util.predicted_cost_callback
- predicted_cost_callback(ctrl, sys_inst) float[source]
Computes the cost for a controller as the actual cost for the current time step and the predicted cost over the rest of the forecast horizon. The “prediction” is actually the solution to the optimization problem solved when updating the sys_inst, so it basically assumes an optimal controller for the future time steps. This is not really in line with the RL paradigm, so use with care!
- Parameters:
ctrl (BaseController) – controller for which we will compute the cost
sys_inst (System) – the system within which the controller operates some subsystem
- Returns:
float – cost of controlling the subsystem