Closed vballoli closed 1 year ago
Hi @vballoli currently RSOME is unable to directly return the solved value of an affine expression like x + y
. The best we can do is to obtain the value using x.get() + y.get()
. I agree with you this is an interesting feature, and we will consider adding it in future versions.
Thanks a lot for considering this feature, greatly appreciate your time on this! I also wanted to appreciate such a neat and well-written package, thank you so much for releasing it and maintaining it as open-source!
Hi @vballoli, the value of an affine (or convex) expression can not be retrieved using RSOME >= 1.14. As mentioned in Solution Analysis, after the model is successfully solved, the value of expr = x + y
can be simply retrieved by calling expr()
.
Besides, the same idea can be used to find the value of a bi-linear expression involving random variables. For example, if expr = x*z + y
, where z
is a random variable, then the value of expr
when z = zhat
is returned by expr(z.assign(zhat))
.
Sorry for the late reply, thank you so much @XiongPengNUS! This is super cool and a nice solution!
Hi, can support be added for
(x+y).get()
given x and y are solved dvars. This will alleviate a lot of boilerplate when tracking a large number of equations. I'm happy to contribute through a PR if this feature is of interest.