-
Notifications
You must be signed in to change notification settings - Fork 40
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
Creating variable for each linear expression #300
Comments
good question! (EDIT HERE, previous answer was wrong) how does linear_expression.coords look like? |
ah, you could take |
It worked, just it is a bit misleading that for parameter named coords you need to send indexes as an argument |
I know, it would be nice if that worked. but I would not know how to realize that. I am closing this issue, but if you don't mind you are could to document your use cases so that we can incorporate them into the documentation later. |
Hi linopyers,
What is the recommended way to create variable for each linear expression? The context is that operation has been done on multidimensional variable resulting in LinearExpresssion object. I need to set soft constraint for that expression so I need variable per each linear expression to create constraint.
For me it was logical to do something like this:
Variable gets created but if I try to print it I get
KeyError: '_term'
The thing that worked (but it looks like too much of work) is:
Maybe in api that is made more for OR people and less for XArray people, we could have an method to generate soft constraint and/or deviation varaible.
The text was updated successfully, but these errors were encountered: