sasoptpy.actions.union¶
-
union
(*args)[source]¶ Aggregates the specified sets and set expressions
- Parameters
- args
sasoptpy.abstract.Set
andsasoptpy.abstract.InlineSet
Objects to be aggregated
- args
Examples
>>> from sasoptpy.actions import union, put_item >>> with so.Workspace('w') as w: >>> n = so.Parameter(name='n', value=11) >>> S = so.Set(name='S', value=so.exp_range(1, n)) >>> T = so.Set(name='T', value=so.exp_range(n+1, 20)) >>> U = so.Set(name='U', value=union(S, T)) >>> put_item(U, names=True) >>> print(so.to_optmodel(w)) proc optmodel; num n = 11; set S = 1..n; set T = n+1..20; set U = S union T; put U=; quit;