commonpower.modeling.robust_cost.WeightedSumRobustCost
- class WeightedSumRobustCost(discount_factor: float = 1.0, weights: list[float] | None = None)[source]
Bases:
_ScenarioBasedCostUtility class to create a robust cost function from a given cost function expression. The cost is calculated as the weighted sum of the costs over all scenarios.
- Parameters:
discount_factor (float, optional) – Discount rate to give lower importance to costs further in the future. The logic is: sum_t (cost_t * df**t). Defaults to 1.0.
weights (list[float], optional) – Weights for each scenario. If not given, all scenarios are weighted equally. Defaults to None.
Methods
add_additional_constraintsAdds additional constraints for the robust cost function to the given model.
initializeInitializes the robust cost function.
Creates the objective function for the robust cost.