-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use SoftConstraint #72
Comments
Hi, have you known how to use soft constraints? |
I never got that working. My best guess is that it was a feature that used to work and got stale. I reimplemented the idea in my project here. It takes an arbitrary constraint and converts it into a squared cost. |
@mpowelson yes! It is good to help me understand them, thanks very much! |
I'm interested in using the SoftConstraint. However, it is not apparent to me how I add it to an ifopt Problem since AddCostSet takes a CostTerm::Ptr, and this is inherits directly from Component.
To that end, I have tried to implement my own Cost in a similar fashion that takes a Constraint and converts it to a cost. However, the jacobian seems a bit problematic since GetJacobian is marked final and FillJacobianBlock is private in Constraint. It seems like my only option is to get the full constraint jacobian and then manually convert that back into something I can use inside my Cost's FillJacobianBlock. Any insight would be appreciated.
The text was updated successfully, but these errors were encountered: