Commit d3e1d3a8 authored by Tjerk Vreeken's avatar Tjerk Vreeken

Rename constraint_relaxation to violation_relaxation

The "constraint_relaxation" name was confusing, as the relaxation is
only indirectly applied to the eventual hard constraint (i.e. it is
scaled by the goal's function nominal as well). The term
violation_relaxation much better describes that this relaxation is
applied to the violation variables (a.k.a. epsilons).
parent efbe3e71
......@@ -449,7 +449,7 @@ class GoalProgrammingMixin(OptimizationProblem, metaclass=ABCMeta):
+---------------------------+-----------+---------------+
| Option | Type | Default value |
+===========================+===========+===============+
| ``constraint_relaxation`` | ``float`` | ``0.0`` |
| ``violation_relaxation`` | ``float`` | ``0.0`` |
+---------------------------+-----------+---------------+
| ``mu_reinit`` | ``bool`` | ``True`` |
+---------------------------+-----------+---------------+
......@@ -464,8 +464,9 @@ class GoalProgrammingMixin(OptimizationProblem, metaclass=ABCMeta):
| ``scale_by_problem_size`` | ``bool`` | ``False`` |
+---------------------------+-----------+---------------+
Constraints generated by the goal programming algorithm are relaxed by applying the
specified relaxation. Use of this option is normally not required.
Before turning a soft constraint of the goal programming algorithm into a hard constraint,
the epsilon of each goal is relaxed with the ``violation_relaxation``. Use of this option is
normally not required.
A goal is considered to be violated if the violation, scaled between 0 and 1, is greater
than the specified tolerance. Violated goals are fixed. Use of this option is normally not
......@@ -505,7 +506,7 @@ class GoalProgrammingMixin(OptimizationProblem, metaclass=ABCMeta):
options = {}
options['mu_reinit'] = True
options['constraint_relaxation'] = 0.0 # Disable by default
options['violation_relaxation'] = 0.0 # Disable by default
options['violation_tolerance'] = np.inf # Disable by default
options['fix_minimized_values'] = False
options['check_monotonicity'] = True
......@@ -1061,7 +1062,7 @@ class GoalProgrammingMixin(OptimizationProblem, metaclass=ABCMeta):
np.full_like(times, epsilon_active), ensemble_member)
# Add a relaxation to appease the barrier method.
epsilon += options['constraint_relaxation']
epsilon += options['violation_relaxation']
else:
epsilon = function_value
......@@ -1117,7 +1118,7 @@ class GoalProgrammingMixin(OptimizationProblem, metaclass=ABCMeta):
self.set_timeseries(goal.violation_timeseries_id, epsilon_active, ensemble_member)
# Add a relaxation to appease the barrier method.
epsilon += options['constraint_relaxation']
epsilon += options['violation_relaxation']
else:
epsilon = function_value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment