Skip to content

Add goal programming with single transcription pass

Tjerk Vreeken requested to merge single-pass-gp-wip into master

A new mixin SinglePassGoalProgrammingMixin is added that does not retranscribe/collocate the problem between priorities. All violation variables and corresponding constraints are added in the first priority. The only constraints that are appended or updated between priorities are those related to the objective.

This mixin serves as an alternative to GoalProgrammingMixin. The shared functionity has been moved to an internal GoalProgrammingMixinBase class. Note that MinAbsGoalProgrammingMixin and LinearizedOrderGoalProgrammingMixin no longer inherit from GoalProgrammingMixin [0], such that they can also be used with the SinglePassGoalProgrammingMixin. It is up to the user to explicitly inherit from GoalProgrammingMixin or SinglePassGoalProgrammingMixin as well.

This commit also adds a CachingQPSol class that can be useful for large problems when used together with SinglePassGoalProgrammingMixin. The Jacobian of the constraints from the previous priority is reused as much as possible, which can save a lot of time for large problems, or problems in which the objective constraint is particularly slowing down the Jacobian calculation due to confusing CasADi's graph coloring. Note that CachingQPSol cannot be used with GoalProgrammingMixin.

[0] This commit is API breaking when looking at the master branch, but there has been no publicly stable release (beta or final) containing the features that we (ever so slightly) break.

Closes #1111 (closed)

Merge request reports