Commit a2c6bf92 authored by Jorn Baayen's avatar Jorn Baayen

Merge branch 'master' into casadi3

parents e92e8414 d0b949de
......@@ -687,10 +687,14 @@ class GoalProgrammingMixin(OptimizationProblem, metaclass = ABCMeta):
# Validate goal definitions
for goal in itertools.chain(goals, path_goals):
if not (isinstance(goal.function_range[0], MX) or np.isfinite(goal.function_range[0])) \
or not (isinstance(goal.function_range[1], MX) or np.isfinite(goal.function_range[1])):
m, M = MX(goal.function_range[0]), MX(goal.function_range[1])
if not m.isRegular() or not M.isRegular():
raise Exception("No function range specified for goal {}".format(goal))
if m >= M:
raise Exception("Invalid function range for goal {}.".format(goal))
if goal.function_nominal <= 0:
raise Exception("Nonpositive nominal value specified for goal {}".format(goal))
try:
......
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