I have a problem with AMPL to do a stochastic programming,
currently I have three scenarios and assign probabilities before each solution.
A for loop is to solve a bunch of SP problem based on new simulated state. And assign its probabilities.
for { t in 1..SIZE-1 by 2} {
let Demand := DemandSeq[t];
let Resources := ResourcesSeq[t];
# change probability of each stage
if StateSequence[t] = 1 # N
then {
let P[1]:= 0.7;
let P[2]:= 0.2;
let P[3]:= 0.1;
}
else if StateSequence[t] = 2 # A
then {
let P[1]:= 0.6;
let P[2]:= 0.3;
let P[3]:= 0.1;
}
else if StateSequence[t] = 3 # M
then {
let P[1]:= 0.5;
let P[2]:= 0.4;
let P[3]:= 0.1;
};
solve;
...
}
Now what if I change this three scenarios problem into a 10 scenarios problem. I already have a 10*10 probability matrix, but I don't know how to assign prob.
param Probs{1..10, 1..10};
data;
param Probs :1 2 3 ... 10 :=1 0.1 0.2 0.05 ... 0.1...
let {i in 1..10} P[i] := Prob[StateSequence[t], i];
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
HTH,param Prob{1..3, 1..3};read {i in 1..3, j in 1..3} Prob[i, j] < prob.txt;