SOSConstraintData

(class from pyomo.core.base.sos)

class pyomo.core.base.sos.SOSConstraintData(owner)[source]

Bases: ActiveComponentData

This class defines the data for a single special ordered set.

Constructor arguments:

owner The Constraint object that owns this data.

Public class attributes:

active A boolean that is true if this objective is active in the model. component The constraint component.

Private class attributes:

_variables SOS variables. _weights SOS variable weights. _level SOS level (Positive Integer)

__init__(owner)[source]

Constructor

Methods

__init__(owner)

Constructor

activate()

Set the active attribute to True

clear_suffix_value(suffix_or_name[, expand])

Set the suffix value for this component data

cname(*args, **kwds)

DEPRECATED.

deactivate()

Set the active attribute to False

get_items()

get_suffix_value(suffix_or_name[, default])

Get the suffix value for this component data

get_variables()

getname([fully_qualified, name_buffer, ...])

Return a string with the component name and index

index()

Returns the index of this ComponentData instance relative to the parent component index set.

is_component_type()

Return True if this class is a Pyomo component

is_expression_type([expression_system])

Return True if this numeric value is an expression

is_indexed()

Return true if this component is indexed

is_logical_type()

Return True if this class is a Pyomo Boolean object.

is_named_expression_type()

Return True if this numeric value is a named expression

is_numeric_type()

Return True if this class is a Pyomo numeric object

is_parameter_type()

Return False unless this class is a parameter object

is_reference()

Return True if this object is a reference.

is_variable_type()

Return False unless this class is a variable object

items()

model()

Return the model of the component that owns this data.

num_variables()

parent_block()

Return the parent of the component that owns this data.

parent_component()

Returns the component associated with this object.

pprint([ostream, verbose, prefix])

Print component information

set_items(variables, weights)

set_suffix_value(suffix_or_name, value[, expand])

Set the suffix value for this component data

type()

DEPRECATED.

Attributes

active

Return the active attribute

ctype

Return the class type for this component

level

Return the SOS level

local_name

Get the component name only within the context of the immediate parent container.

name

Get the fully qualified component name.

variables

Return the variable list for the SOS constraint

Member Documentation

activate()

Set the active attribute to True

clear_suffix_value(suffix_or_name, expand=True)

Set the suffix value for this component data

cname(*args, **kwds)

DEPRECATED.

Deprecated since version 5.0: The cname() method has been renamed to getname(). The preferred method of obtaining a component name is to use the .name property, which returns the fully qualified component name. The .local_name property will return the component name only within the context of the immediate parent container.

deactivate()

Set the active attribute to False

get_suffix_value(suffix_or_name, default=None)

Get the suffix value for this component data

getname(fully_qualified=False, name_buffer=None, relative_to=None)

Return a string with the component name and index

index()

Returns the index of this ComponentData instance relative to the parent component index set. None is returned if this instance does not have a parent component, or if - for some unknown reason - this instance does not belong to the parent component’s index set.

is_component_type()

Return True if this class is a Pyomo component

is_expression_type(expression_system=None)

Return True if this numeric value is an expression

is_indexed()

Return true if this component is indexed

is_logical_type()

Return True if this class is a Pyomo Boolean object.

Boolean objects include constants, variables, or logical expressions.

is_named_expression_type()

Return True if this numeric value is a named expression

is_numeric_type()

Return True if this class is a Pyomo numeric object

is_parameter_type()

Return False unless this class is a parameter object

is_reference()

Return True if this object is a reference.

is_variable_type()

Return False unless this class is a variable object

model()

Return the model of the component that owns this data.

parent_block()

Return the parent of the component that owns this data.

parent_component()

Returns the component associated with this object.

pprint(ostream=None, verbose=False, prefix='')

Print component information

Note that this method is generally only reachable through ComponentData objects in an IndexedComponent container. Components, including unindexed Component derivatives and both scalar and indexed IndexedComponent derivatives will see Component.pprint()

set_suffix_value(suffix_or_name, value, expand=True)

Set the suffix value for this component data

type()

DEPRECATED.

Return the class type for this component

Deprecated since version 5.7: Component.type() method has been replaced by the .ctype property.

property active

Return the active attribute

property ctype

Return the class type for this component

property level

Return the SOS level

property local_name

Get the component name only within the context of the immediate parent container.

property name

Get the fully qualified component name.

property variables

Return the variable list for the SOS constraint