Commit f8418847 authored by Jorn Baayen's avatar Jorn Baayen

Fix goal programming unit tests

parent 862b3343
......@@ -1746,7 +1746,7 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass = A
accumulation_constant_inputs = transpose(horzcat(*accumulation_constant_inputs))
# Map
[values] = fmap([accumulation_states, accumulation_derivatives,
values = fmap(accumulation_states, accumulation_derivatives,
accumulation_constant_inputs, repmat(vertcat(*self._parameter_values_ensemble_member_0), 1, n_collocation_times),
np.transpose(collocation_times)])
np.transpose(collocation_times))
return transpose(values)
......@@ -27,6 +27,11 @@ class TestProblem(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegratedOptim
# Collocation points
return np.linspace(0.0, 1.0, 21)
def parameters(self, ensemble_member):
parameters = super().parameters(ensemble_member)
parameters['u_max'] = 2.0
return parameters
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
......@@ -248,6 +253,11 @@ class TestProblemPathGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegr
# Collocation points
return np.linspace(0.0, 1.0, 21)
def parameters(self, ensemble_member):
parameters = super().parameters(ensemble_member)
parameters['u_max'] = 2.0
return parameters
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
......@@ -418,6 +428,11 @@ class TestProblemPathGoalsSmoothing(GoalProgrammingMixin, ModelicaMixin, Colloca
# Collocation points
return np.linspace(0.0, 1.0, 21)
def parameters(self, ensemble_member):
parameters = super().parameters(ensemble_member)
parameters['u_max'] = 2.0
return parameters
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
......@@ -481,6 +496,11 @@ class TestProblemStateGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedInteg
# Collocation points
return np.linspace(0.0, 1.0, 21)
def parameters(self, ensemble_member):
parameters = super().parameters(ensemble_member)
parameters['u_max'] = 2.0
return parameters
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
......
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