Can LinExpr or another equivalent be used for calculation of outputs.
AnsweredI currently us LinExpr to build up an objective function using multiple cost terms. Example obj = labor + transportation.
It also appears we can call this after model solve to get the cost corresponding to the LinExpr we created. Example labor.getValue().
Is it possible to leverage the LinExpr to create custom calculations for output purposes that won't add to our model?
0
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Yes, you can create arbitrary LinExpr objects from your model's variables and -- once the model is solved -- access the expression's value with the getValue-method.
1 -
Thanks
0
Post is closed for comments.
Comments
3 comments