Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
<-- Ready to Review - done - Lauren--> Sets in AMPL | ||||||||
Line: 152 to 152 | ||||||||
set MONTHS ordered; | ||||||||
Changed: | ||||||||
< < | AMPL will puts the elements in this set in the order they appear in the data file (or let statement). AMPL also understands the following operations for ordered sets: | |||||||
> > | AMPL will put the elements in this set in the order they appear in the data file (or let statement). AMPL also understands the following operations for ordered sets: | |||||||
ord(e, ORD_SET) # The position of e in ORD_SET | ||||||||
Line: 194 to 194 | ||||||||
Set Membership and Subsets | ||||||||
Changed: | ||||||||
< < | We have seen how loop over a set using the in keyword. This keyword also provides a logical check if an element is in a set, e.g., (m, n) in ARCS is true if the pair (m, n) is in the set ARCS and false otherwise. We may restrict a set to be a subset of an existing set by using the keyword {\tt within}, e. g., | |||||||
> > | We have seen how to loop over a set using the in keyword. This keyword also provides a logical check if an element is in a set, e.g., (m, n) in ARCS is true if the pair (m, n) is in the set ARCS and false otherwise. We may restrict a set to be a subset of an existing set by using the keyword within , e. g., | |||||||
set ARCS within NODES cross NODES; |