-
Notifications
You must be signed in to change notification settings - Fork 3
Description
The documentation for optimizerFORCES states that the returned controller object should be called with the parameter values:
solver = optimizerFORCES(...);
x = solver{paramValues};
It is not specified (and does not seem to matter much) whether paramValues is a list of parameter values (used in mpc_parametric_dynamics.m):
[U(:,k),exitflag,info] = controller{ X(:,k), A, B };
or a cell array with the parameter values (used in mpc_parametric_cost.m):
[U(:,k),exitflag,info] = controller{ {X(:,k), Q,R,P} };
The generated solver on the other hand requires the parameter values to be provided in a cell array and will complain when provided with a list of parameters.
What is the intended use of the controller object?
On the one hand, for consistency it would be great to call controller the same way you would call solver. This would require cell arrays also for the controller object, but for problems with a single parameter, e.g. the simple MPC example, the notation controller{ {x0} } is not so nice.
On the other hand, having both calling conventions for the controller object will probably lead to errors and confusion down the line. The controller object is not persistent after all and requires the entire code generation to run again, there is not way to create a controller object for a previously generated solver (or is there?).
Thoughts?