XiongPengNUS / rsome

Robust Stochastic Optimization Made Easy
GNU General Public License v3.0
282 stars 54 forks source link

Inventory example unfeasible decision variables values? #34

Closed GalPerelman closed 1 year ago

GalPerelman commented 1 year ago

When running the Joint Production-Inventory example, the value of the decision variables seems unreasonable. See the following where some of the values of p (decision variables) are below 0 or above 567 which defines as max production

print(p.get())

[[  567.           567.           567.           567.           311.79394372 -1134.
  -1134.           567.           567.           567.           567.          -933.
   -788.29142706   567.           567.         -1134.           131.4183419   -288.2330632
  -1134.         -1105.86442945 -1134.         -1134.           358.40744841   313.23942347]
 [  567.          -633.          -788.29142706   413.52813742   567.           567.
    567.          -501.85800295 -1134.         -1134.            40.73593129  -548.68121459
    567.          -722.29142706  -666.          -417.47186258  -226.76951546 -1134.
    -53.44450423  -151.9941849     33.46441973     0.          1701.            78.55549577]
 [  567.           567.           519.29142706  -897.68542495 -1070.43255096   737.13737085
      0.          -164.14199705   567.           393.09333067  -732.          1258.41714588
     66.             0.             0.          1701.             0.           840.04340341
      0.           731.14199705   512.36017873  1646.82303613  1701.          1701.        ]]

Is that a bug? If not, what is the meaning of such values?

XiongPengNUS commented 1 year ago

Hi @GalPerelman, the adaptive decisions are represented by an affine expression, instead of a fixed value, such as in the case of the joint product-inventory, the adaptive decision p is written as p = p0 + p1*d, where d is a vector of random demands. In RSOME, p.get() gives the coefficients of p0, and the coefficients of p1 are retrieved using p.get(d).

GalPerelman commented 1 year ago

Now it's clear, I somehow missed it in the documentation Thank you @XiongPengNUS for the explanation and for this great package