# ordered set syntax

**URL:** <https://discourse.julialang.org/t/ordered-set-syntax/15902>\
**Category:** General Usage\
**Tags:** jump\
**Created:** [October 4, 2018, 9:27pm UTC](https://discourse.julialang.org/t/ordered-set-syntax/15902 "2018-10-04T21:27:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryao](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@Ryao](https://discourse.julialang.org/u/Ryao)\
**Post date:** [October 4, 2018, 9:27pm UTC](https://discourse.julialang.org/t/ordered-set-syntax/15902/1 "2018-10-04T21:27:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GerhardTotschnig](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gerhardtotschnig/32/215516_2.png) [@GerhardTotschnig](https://discourse.julialang.org/u/GerhardTotschnig)\
**Post date:** [May 22, 2020, 11:37am UTC](https://discourse.julialang.org/t/ordered-set-syntax/15902/2 "2020-05-22T11:37:20Z")

</div>

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