commonpower.control.util

Helper functions for control module.

Functions

clone_from_top_level_nodes

Generates a new model instance from the given top-level nodes while also cloning their children.

predicted_cost_callback

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.

single_step_cost_callback

Computes the cost for a controller as the actual cost for the current time step.

t2n

Transform a torch tensor to a numpy array.