commonpower.control.safety_layer.penalties.DistanceDependingPenalty

class DistanceDependingPenalty(penalty_factor: float = 0.1)[source]

Bases: BasePenalty

Penalty depending on the distance between the proposed action and the corrected action. :param penalty_factor: factor for penalty :type penalty_factor: float

Returns:

None

Methods

get_correction_penalty

Computes the penalty.

get_correction_penalty(safety_obj: float) float[source]

Computes the penalty. :param safety_obj: The optimal value of the objective function of the safety shield :type safety_obj: float

Returns:

float – penalty_value