ordered set syntax

In AMPL, I can use something like:

set Time ordered;
s.t. Inv{t in Time: ord(t) >=2}: Inv[t]= Inv[prev(t)] + ordered[prev(t)] - shipped[t];

I know I can use numbered index and use t-1 in this case. But if the elements of the set are defined using strings or expressions, then what should I do?

I am not sure if there is similar syntax in JuMP to do similar things for the ord() and prev() functions in ampl.

1 Like

I would be interested in this topic too! Is there a sulution in JuMP?