Dear Bob,
I'd like to calculate the minimum production quantity with respect to a fill rate constraint.
However, I want my algorithm to run until the target service level is reached.
Algorithm:
model C:\AMPL\qopt.mod;
for {tau in Ruestperioden} {
let q[tau] := 0;
let qstrich[tau] := -epsilon;
repeat until BetaLos{t in 1..T} = BetaLosStern {
repeat while (q[tau] - qstrich[tau]) >= epsilon
{
let {t in tau..T: t = tau} I[t] := I[t-1] + q[tau] - D[t];
let {t in tau..T: t > tau} I[t] := I[t-1] - D[t];
let {t in 1..T: tau <= t} Iprod[t] := -min(0,I[t-1] + q[tau]);
let {t in 1..T} Iend[t] := -min(0,I[t]);
let {t in 1..T} F[t] := Iend[t]-Iprod[t];
let {t in 1..T: tau <= t} BetaLos[t] := 1 - ((sum{i in tau..t} F[i]) / (sum{i in tau..t} D[i]));
let qstrich[tau] := q[tau];
let {t in 1..next(tau, Ruestperioden) -1: tau +1 <= T} deltabeta := BetaLosStern - BetaLos[t]; # evtl 2 Indizes Für BetaLos
if (deltabeta > 0) then {
let {t in 1..next(tau, Ruestperioden) -1: tau +1 <= T} q[tau] := q[tau] + deltabeta * D[t];
} } }}
option solver cplex;
solve;
display q > C:\AMPL\qopt.sol;
Error message:
C:\AMPL\qopt.run, line 13 (offset 236):
syntax error
context: repeat until >>> {BetaLos{ <<< t in 1..T} = BetaLosStern} {
BetaLos was defined as BetaLos{t in 1..T} in the .mod-file
Do you have any idea, how I could solve this problem?
Thanks a lot in advance, best regards.