IntervalVarPresence

(class from pyomo.contrib.cp.interval_var)

class pyomo.contrib.cp.interval_var.IntervalVarPresence(*args, **kwds)[source]

Bases: ScalarBooleanVar

This class defines the abstract interface for a single Boolean variable denoting whether or not an IntervalVar is scheduled

__init__(*args, **kwd)[source]

Methods

__init__(*args, **kwd)

add(index)

Add a variable with a particular index.

associate_binary_var(binary_var)

Associate a binary VarData to this BooleanVarData

clear()

Clear the data in this component

clear_suffix_value(suffix_or_name[, expand])

Set the suffix value for this component data

cname(*args, **kwds)

DEPRECATED.

construct([data])

Construct this component.

dim()

Return the dimension of the index

display([ostream, verbose, prefix])

equivalent_to(other)

Construct an EquivalenceExpression between this BooleanValue and its operand.

extract_values([include_fixed_values])

Return a dictionary of index-value pairs.

fix([value, skip_validation])

Set the fixed indicator to True.

flag_as_stale()

Set the 'stale' attribute of every variable data object to True.

free()

Alias for unfix()

get_associated_binary()

Get the binary VarData associated with this BooleanVarData

get_associated_interval_var()

get_suffix_value(suffix_or_name[, default])

Get the suffix value for this component data

get_values([include_fixed_values])

Return a dictionary of index-value pairs.

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

Return a string with the component name and index

id_index_map()

Return an dictionary id->index for all ComponentData instances.

implies(other)

Construct an ImplicationExpression using method "implies"

index()

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

index_set()

Return the index set

is_component_type()

Return True if this class is a Pyomo component

is_constant()

Returns False because this is not a constant in an expression.

is_constructed()

Return True if this class has been constructed

is_expression_type([expression_system])

Return True if this numeric value is an expression

is_fixed()

Returns True if this variable is fixed, otherwise returns False.

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()

Boolean values are not numeric.

is_parameter_type()

Return False unless this class is a parameter object

is_potentially_variable()

Returns True because this is a variable.

is_reference()

Return True if this component is a reference, where "reference" is interpreted as any component that does not own its own data.

is_relational()

DEPRECATED.

is_variable_type()

Returns True because this is a variable.

items([sort, ordered])

Return an iterator of (index,data) component data tuples

iteritems()

DEPRECATED.

iterkeys()

DEPRECATED.

itervalues()

DEPRECATED.

keys([sort, ordered])

Return an iterator over the component data keys

land(other)

Construct an AndExpression (Logical And) between this BooleanValue and other.

lor(other)

Construct an OrExpression (Logical OR) between this BooleanValue and 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, verbose, prefix])

Print component information

reconstruct([data])

REMOVED: reconstruct() was removed in Pyomo 6.0.

root_block()

Return self.model()

set_suffix_value(suffix_or_name, value[, expand])

Set the suffix value for this component data

set_value(val[, skip_validation])

Set the value of this numeric object, after validating its value.

set_values(new_values[, skip_validation])

Set data values from a dictionary.

to_dense_data()

TODO

to_string([verbose, labeler, smap, ...])

Return a string representation of the expression tree.

type()

DEPRECATED.

unfix()

Sets the fixed indicator to False.

valid_model_component()

Return True if this can be used as a model component.

values([sort, ordered])

Return an iterator of the component data objects

xor(other)

Construct an XorExpression using method "xor"

Attributes

active

Return the active attribute

ctype

Return the class type for this component

domain

the domain for this variable.

fixed

local_name

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

name

Get the fully qualified component name.

stale

A Boolean indicating whether the value of this variable is Consistent with the most recent solve.

value

the current value of this variable.

Member Documentation

add(index)

Add a variable with a particular index.

associate_binary_var(binary_var)

Associate a binary VarData to this BooleanVarData

clear()

Clear the data in this component

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.

construct(data=None)

Construct this component.

dim()

Return the dimension of the index

equivalent_to(other)

Construct an EquivalenceExpression between this BooleanValue and its operand.

extract_values(include_fixed_values=True)

Return a dictionary of index-value pairs.

fix(value=NOTSET, skip_validation=False)

Set the fixed indicator to True. Value argument is optional, indicating the variable should be fixed at its current value.

flag_as_stale()

Set the ‘stale’ attribute of every variable data object to True.

free()

Alias for unfix()

get_associated_binary()

Get the binary VarData associated with this BooleanVarData

get_suffix_value(suffix_or_name, default=None)

Get the suffix value for this component data

get_values(include_fixed_values=True)

Return a dictionary of index-value pairs.

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

Return a string with the component name and index

id_index_map()

Return an dictionary id->index for all ComponentData instances.

implies(other)

Construct an ImplicationExpression using method “implies”

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.

index_set()

Return the index set

is_component_type()

Return True if this class is a Pyomo component

is_constant()

Returns False because this is not a constant in an expression.

is_constructed()

Return True if this class has been constructed

is_expression_type(expression_system=None)

Return True if this numeric value is an expression

is_fixed()

Returns True if this variable is fixed, otherwise returns False.

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()

Boolean values are not numeric.

is_parameter_type()

Return False unless this class is a parameter object

is_potentially_variable()

Returns True because this is a variable.

is_reference()

Return True if this component is a reference, where “reference” is interpreted as any component that does not own its own data.

is_relational()

DEPRECATED.

Return True if this Logical value represents a relational expression.

Deprecated since version 6.4.3: is_relational() is deprecated in favor of is_expression_type(ExpressionType.RELATIONAL)

is_variable_type()

Returns True because this is a variable.

items(sort=<SortComponents.UNSORTED: 0>, ordered=NOTSET)

Return an iterator of (index,data) component data tuples

Parameters:
  • sort (bool or SortComponents) – Iterate over the declared component items in a specified sorted order. See SortComponents for valid options and descriptions.

  • ordered (bool) – DEPRECATED: Please use sort=SortComponents.ORDERED_INDICES. If True, then the items are returned in a deterministic order (using the underlying set’s ordered_iter().

iteritems()

DEPRECATED.

Return a list (index,data) tuples from the dictionary

Deprecated since version 6.0: The iteritems method is deprecated. Use dict.items().

iterkeys()

DEPRECATED.

Return a list of keys in the dictionary

Deprecated since version 6.0: The iterkeys method is deprecated. Use dict.keys().

itervalues()

DEPRECATED.

Return a list of the component data objects in the dictionary

Deprecated since version 6.0: The itervalues method is deprecated. Use dict.values().

keys(sort=<SortComponents.UNSORTED: 0>, ordered=NOTSET)

Return an iterator over the component data keys

This method sets the ordering of component data objects within this IndexedComponent container. For consistency, __init__(), values(), and items() all leverage this method to ensure consistent ordering.

Parameters:
  • sort (bool or SortComponents) – Iterate over the declared component keys in a specified sorted order. See SortComponents for valid options and descriptions.

  • ordered (bool) – DEPRECATED: Please use sort=SortComponents.ORDERED_INDICES. If True, then the keys are returned in a deterministic order (using the underlying set’s ordered_iter()).

land(other)

Construct an AndExpression (Logical And) between this BooleanValue and other.

lor(other)

Construct an OrExpression (Logical OR) between this BooleanValue and 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

reconstruct(data=None)

REMOVED: reconstruct() was removed in Pyomo 6.0.

Re-constructing model components was fragile and did not correctly update instances of the component used in other components or contexts (this was particularly problemmatic for Var, Param, and Set). Users who wish to reproduce the old behavior of reconstruct(), are comfortable manipulating non-public interfaces, and who take the time to verify that the correct thing happens to their model can approximate the old behavior of reconstruct with:

component.clear() component._constructed = False component.construct()

root_block()

Return self.model()

set_suffix_value(suffix_or_name, value, expand=True)

Set the suffix value for this component data

set_value(val, skip_validation=False)

Set the value of this numeric object, after validating its value. If the ‘valid’ flag is True, then the validation step is skipped.

set_values(new_values, skip_validation=False)

Set data values from a dictionary.

The default behavior is to validate the values in the dictionary.

to_dense_data()

TODO

to_string(verbose=None, labeler=None, smap=None, compute_values=False)

Return a string representation of the expression tree.

Parameters:
  • verbose (bool) – If True, then the the string representation consists of nested functions. Otherwise, the string representation is an algebraic equation. Defaults to False.

  • labeler – An object that generates string labels for variables in the expression tree. Defaults to None.

Returns:

A string representation for the expression tree.

type()

DEPRECATED.

Return the class type for this component

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

unfix()

Sets the fixed indicator to False.

valid_model_component()

Return True if this can be used as a model component.

values(sort=<SortComponents.UNSORTED: 0>, ordered=NOTSET)

Return an iterator of the component data objects

Parameters:
  • sort (bool or SortComponents) – Iterate over the declared component values in a specified sorted order. See SortComponents for valid options and descriptions.

  • ordered (bool) – DEPRECATED: Please use sort=SortComponents.ORDERED_INDICES. If True, then the values are returned in a deterministic order (using the underlying set’s ordered_iter().

xor(other)

Construct an XorExpression using method “xor”

property active

Return the active attribute

property ctype

Return the class type for this component

property domain

the domain for this variable.

Type:

BooleanSet

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 stale

A Boolean indicating whether the value of this variable is Consistent with the most recent solve. True indicates that this variable’s value was set prior to the most recent solve and was not updated by the results returned by the solve.

Type:

bool

property value

the current value of this variable.

Type:

bool