Commit 4f51c157 authored by Jorn Baayen's avatar Jorn Baayen

ModelicaMixin: Throw a more descriptive exception when bounds contain...

ModelicaMixin:  Throw a more descriptive exception when bounds contain parameters that were not set.
parent b5b6d395
......@@ -276,7 +276,11 @@ class ModelicaMixin(OptimizationProblem):
values.append(alias.sign * parameters[alias.name])
break
[val] = substitute([attr], symbols, values)
return float(val)
if val.isConstant():
return float(val)
else:
deps = [val.getDep(i).getName() for i in range(val.getNdeps())]
raise Exception("Parameters with names {} not set.".format(deps))
for sym in self._mx['states'] + self._mx['algebraics'] + self._mx['control_inputs']:
variable = sym.getName()
......
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