FiniteSetData

(class from pyomo.core.base.set)

class pyomo.core.base.set.FiniteSetData(component)[source]

Bases: _FiniteSetMixin, SetData

A general unordered iterable Set

__init__(component)[source]

Methods

__init__(component)

add(*values)

bounds()

check_values()

DEPRECATED.

clear()

clear_suffix_value(suffix_or_name[, expand])

Set the suffix value for this component data

cname(*args, **kwds)

DEPRECATED.

cross(*args)

Return the cross-product between this set and one or more sets

data()

difference(*args)

Return the difference between this set with one or more sets

discard(val)

get(value[, default])

Return True if the set contains a given value.

get_interval()

Return the interval for this Set as (start, end, step)

get_suffix_value(suffix_or_name[, default])

Get the suffix value for this component data

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.

intersection(*args)

Return the intersection of this set with one or more sets

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

isdiscrete()

Returns True if this set admits only discrete members

isdisjoint(other)

Test if this Set is disjoint from other

isfinite()

Returns True if this is a finite discrete (iterable) Set

isordered()

Returns True if this is an ordered finite discrete (iterable) Set

issubset(other)

Test if this Set is a subset of other

issuperset(other)

Test if this Set is a superset of other

model()

Return the model of the component that owns this data.

ordered_data()

ordered_iter()

parent_block()

Return the parent of the component that owns this data.

parent_component()

Returns the component associated with this object.

pop()

pprint([ostream, verbose, prefix])

Print component information

ranges()

remove(val)

set_suffix_value(suffix_or_name, value[, expand])

Set the suffix value for this component data

set_value(val)

sorted_data()

sorted_iter()

subsets([expand_all_set_operators])

symmetric_difference(other)

Return the symmetric difference of this set with another set

type()

DEPRECATED.

union(*args)

Return the union of this set with one or more sets.

update(values)

Attributes

active

Return the active attribute

concrete

DEPRECATED.

ctype

Return the class type for this component

dimen

domain

filter

DEPRECATED.

local_name

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

name

Get the fully qualified component name.

ordered

DEPRECATED.

value

DEPRECATED.

value_list

DEPRECATED.

virtual

DEPRECATED.

Member Documentation

check_values()

DEPRECATED.

Verify that the values in this set are valid.

Deprecated since version 5.7: check_values() is deprecated: Sets only contain valid members

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.

cross(*args)

Return the cross-product between this set and one or more sets

difference(*args)

Return the difference between this set with one or more sets

get(value, default=None)[source]

Return True if the set contains a given value.

This method will raise TypeError for unhashable types.

get_interval()

Return the interval for this Set as (start, end, step)

Returns the effective interval for this Set as a (start, end, step) tuple. Start and End are the same as returned by bounds(). Step is 0 for continuous ranges, a positive value for regular discrete sets (e.g., 1 for Integers), or None for Sets that do not have a regular interval (e.g., semicontinuous sets, mixed type sets, sets with dimen != 1, etc).

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.

intersection(*args)

Return the intersection of this set with one or more sets

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

isdiscrete()

Returns True if this set admits only discrete members

isdisjoint(other)

Test if this Set is disjoint from other

Parameters:

other (Set or iterable) – The Set or iterable object to compare this Set against

Returns:

bool

Return type:

True if this set is disjoint from other

isfinite()

Returns True if this is a finite discrete (iterable) Set

isordered()

Returns True if this is an ordered finite discrete (iterable) Set

issubset(other)

Test if this Set is a subset of other

Parameters:

other (Set or iterable) – The Set or iterable object to compare this Set against

Returns:

bool

Return type:

True if this set is a subset of other

issuperset(other)

Test if this Set is a superset of other

Parameters:

other (Set or iterable) – The Set or iterable object to compare this Set against

Returns:

bool

Return type:

True if this set is a superset of other

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

symmetric_difference(other)

Return the symmetric difference of this set with another set

type()

DEPRECATED.

Return the class type for this component

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

union(*args)

Return the union of this set with one or more sets.

property active

Return the active attribute

property concrete

DEPRECATED.

Deprecated since version 5.7: The ‘concrete’ attribute is no longer supported. Use isdiscrete() or isfinite()

property ctype

Return the class type for this component

property filter

DEPRECATED.

Deprecated since version 5.7: ‘filter’ is no longer a public attribute.

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 ordered

DEPRECATED.

Deprecated since version 5.7: The ‘ordered’ attribute is no longer supported. Use isordered()

property value

DEPRECATED.

Deprecated since version 5.7: The ‘value’ attribute is deprecated. Use .data() to retrieve the values in a finite set.

property value_list

DEPRECATED.

Deprecated since version 5.7: The ‘value_list’ attribute is deprecated. Use .ordered_data() to retrieve the values from a finite set in a deterministic order.

property virtual

DEPRECATED.

Deprecated since version 5.7: The ‘virtual’ attribute is no longer supported