set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago Albany Houston Tempe Gary ;
> >
set NODES := Youngstown Pittsburgh Cincinnati 'Kansas City' Chicago
Albany Houston Tempe Gary ;
although they may be defined during declaration using either an explicit set literal or using a set expression:
Line: 252 to 253
# The set of time-staged arcs
set TIME_ARCS within TIME_NODES cross TIME_NODES :=
{ (m, t) in TIME_NODES, (n, u) in TIME_NODES :
Changed:
< <
( ( (m, n) in ARCS) and (t = u) ) or # The arcs used for transportation
( (m = n) and (ord(t, MONTHS) + 1 = ord(u, MONTHS)) )}; # The arcs used for storage
> >
( ( (m, n) in ARCS) and (t = u) ) or # The transportation arcs
( (m = n) and (ord(t, MONTHS) + 1 = ord(u, MONTHS)) )}; # The storage arcs
to create TIME_ARCS you could use these statements
Line: 263 to 264
set STORAGE_ARCS := union {t in MONTHS, (m, n) in ARCS : t <> last(MONTHS)}
{(m, t, n, next(t, MONTHS)};
Changed:
< <
set TIME_ARCS within TIME_NODES cross TIME_NODES := TRANSPORT_ARCS union STORAGE_ARCS;
> >
set TIME_ARCS within TIME_NODES cross TIME_NODES :=
TRANSPORT_ARCS union STORAGE_ARCS;
Rather than looping over all possibilities and only keeping those that are appropriate, the new statement only loops over smaller sets that can be used to build up the TIME_NODES set efficiently.