sasoptpy.abstract.ParameterGroup¶
-
class
ParameterGroup
(**kwargs)[source]¶ Bases:
object
Represents a group of input parameters
- Parameters
- index_keyiterable
Index key of the group members
- namestring
Name of the parameter group
- ptypestring, optional
Type of the parameters. Possible values are sasoptpy.STR and sasoptpy.NUM
- valuefloat, optional
Value of the parameter
- initfloat, optional
Initial value of the parameter
Examples
>>> from sasoptpy.actions import for_loop >>> with so.Workspace('w') as w: ... p = so.ParameterGroup(so.exp_range(1, 6), name='p', init=3) ... p[0].set_value(3) ... S = so.Set(name='S', value=so.exp_range(1, 6)) ... for i in for_loop(S): ... p[i].set_value(1) ... >>> print(so.to_optmodel(w)) proc optmodel; num p {1..5} init 3; p[0] = 3; set S = 1..5; for {o13 in S} do; p[o13] = 1; end; quit;