Closed brynpickering closed 4 months ago
Hey @brynpickering, thanks for your comment. This would actually be quite nice. We could add a solution attribute to the LinearExpression/QuadraticExpression class. Since these are always referenced to a model instance, it will be easy to retrieve/process the values.
I was about to open an issue before I saw this already existing one. The proposed feature would be a great benefit for us, since our models consist of a composition of many linear expressions, but each expression itself is an important part of subsequent analyses.
I totally agree, the feature is coming in #249 :)
Variables have computed values in the solution after a successful model solve, but linear expressions do not.
It would be great for solution values to be computed for any linear expressions that are stored in memory at solve time. Or, like Pyomo, to have linear expressions added to the model (
add_linexpr
?) and then have values computed for those expressions on a successful solve.