sasoptpy.abstract.Set

class Set(**kwargs)[source]

Bases: object

Creates an index set to be represented inside PROC OPTMODEL

Parameters
namestring

Name of the parameter

initExpression, optional

Initial value expression of the parameter

settypelist, optional

List of types for the set, consisting of ‘num’ and ‘str’ values

Examples

>>> I = so.Set('I')
>>> print(I._defn())
set I;
>>> J = so.Set('J', settype=['num', 'str'])
>>> print(J._defn())
set <num, str> J;
>>> N = so.Parameter(name='N', init=5)
>>> K = so.Set('K', init=so.exp_range(1,N))
>>> print(K._defn())
set K = 1..N;