### Stochastic Linear Programming - Multiple Randomness

Posted:

**Thu Apr 12, 2018 4:21 am**Hi Experts,

I am new to Stochastic Programming in GAMS, so sorry if this question is dumb.

I have one small and simple linear programming problem with 16 variables and 9 constraints. Three of the 9 constraints have their right hand side parameters random, which are also obeying a discrete distribution. Then I modeled this problem and used the following codes trying to solve them.
The codes are nothing new. I just copied and pasted the two-stage SP problem codes in the documentation. Then I ran the codes and found that it returned no solution, saying that "Random variable d3_var in stage 1 with fixed value 3" and "Stage 1 RV [d1] with more than one realization", "cannot build regular tree from random variables".

Actually I thought my problem is a one-stage problem so I did not define stages. And I also defined d1, d2, d3 as scalars giving them values as 5, 4 and 3 at the beginning of the model.

Thank you for any suggestion for this issue!

Gabriel

I am new to Stochastic Programming in GAMS, so sorry if this question is dumb.

I have one small and simple linear programming problem with 16 variables and 9 constraints. Three of the 9 constraints have their right hand side parameters random, which are also obeying a discrete distribution. Then I modeled this problem and used the following codes trying to solve them.

Code: Select all

```
File emp / '%emp.info%' /;
put emp '* problem %gams.i%'/;
$onput
randvar d1 discrete 0.00005 0.5 0.00125 1.0 0.02150 2.5 0.28570 3.5 0.38300 5.0 0.28570 6.5 0.02150 7.5 0.00125 9.0 0.00005 9.5
randvar d2 discrete 0.00130 0.0 0.02150 1.5 0.28570 2.5 0.38300 4.0 0.28570 5.5 0.02150 6.5 0.00125 8.0 0.00005 8.5
randvar d2 discrete 0.00130 0.0 0.02150 0.5 0.28570 1.5 0.38300 3.0 0.28570 4.5 0.02150 5.5 0.00125 7.0 0.00005 7.5
$offput
putclose emp;
Set scen "scenarios" / s1*s576 /;
Parameter
s_d1(scen) "demand realization by scenario"
s_d2(scen) "demand realization by scenario"
s_d3(scen) "demand realization by scenario";
Set dict / scen .scenario.''
d1 .randvar .s_d1
d2 .randvar .s_d2
d3 .randvar .s_d3
/;
solve prob minimizing obj use EMP scenario dict;
```

Actually I thought my problem is a one-stage problem so I did not define stages. And I also defined d1, d2, d3 as scalars giving them values as 5, 4 and 3 at the beginning of the model.

Thank you for any suggestion for this issue!

Gabriel