AMPL will not let you execute model
alpdec.mod
inside your for
loop. That would cause all of your model definition statements to be executed again at every pass though the loop — but AMPL only allows a set
, param
, var
, etc. to be defined once.
Instead, you should move model
alpdec.mod
so that it comes before the loop, and then inside the loop you should only change the model’s set and param data.
If you still have trouble after you make this change, then upload all of your revised files here. (ALP_model.mod and alpdec.mod did not upload properly, so even if you do not change them, you should try uploading them again.)