class, variable_sequence, sos_type, weights=None, name=None)[source]


This class models Special Ordered Sets (SOS) of decision variables. An SOS has a type (SOS1, SOS2) and an ordered list of variables.

This class is not meant to be instantiated directly. To create an SOS, use the,, and methods in Model.


This property is used to get or set the Benders annotation of a SOS variable set. The value of the annotation must be a positive integer


Iterates over the variables in the SOS.

Note that the sequence of variables cannot be empty.

Returns:An iterator.

This property returns the type of the SOS variable set.

Returns:An enumerated value of type

Converts an SOS of variables to a string.

This function is used by the __str__() method

Returns:A string representation of the SOS of variables.