functional_value

(class from pyomo.core.kernel.parameter)

class pyomo.core.kernel.parameter.functional_value(fn=None)[source]

Bases: IParameter

An object for storing a numeric function that can be used in a symbolic expression.

Note that models making use of this object may require the dill module for serialization.

__init__(fn=None)[source]

Methods

__init__([fn])

activate()

Activate this object.

clone()

Returns a copy of this object with the parent pointer set to None.

deactivate()

Deactivate this object.

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

Dynamically generates a name for this object.

is_component_type()

Return True if this class is a Pyomo component

is_constant()

A boolean indicating that this parameter is constant.

is_expression_type([expression_system])

Return True if this numeric value is an expression

is_fixed()

A boolean indicating that this parameter is fixed.

is_indexed()

Return True if this numeric value is an indexed object

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

A boolean indicating that this is a parameter object.

is_potentially_variable()

Returns False because this object can never reference variables.

is_reference()

Return True if this object is a reference.

is_relational()

DEPRECATED.

is_variable_type()

A boolean indicating that this is a variable object.

polynomial_degree()

Always return zero because we always validate that the stored expression can never reference variables.

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

Return a string representation of the expression tree.

Attributes

active

The active status of this object.

ctype

The object's category type.

fn

The function stored with this object

local_name

The object's local name within the context of its parent.

name

The object's fully qualified name.

parent

The object's parent (possibly None).

storage_key

The object's storage key within its parent

Member Documentation

activate()

Activate this object.

clone()

Returns a copy of this object with the parent pointer set to None.

A clone is almost equivalent to deepcopy except that any categorized objects encountered that are not descendents of this object will reference the same object on the clone.

deactivate()

Deactivate this object.

getname(fully_qualified=False, name_buffer={}, convert=<class 'str'>, relative_to=None)

Dynamically generates a name for this object.

Parameters:
  • fully_qualified (bool) – Generate a full name by iterating through all ancestor containers. Default is False.

  • convert (function) – A function that converts a storage key into a string representation. Default is the built-in function str.

  • relative_to (object) – When generating a fully qualified name, generate the name relative to this block.

Returns:

If a parent exists, this method returns a string representing the name of the object in the context of its parent; otherwise (if no parent exists), this method returns None.

is_component_type()

Return True if this class is a Pyomo component

is_constant()

A boolean indicating that this parameter is constant.

is_expression_type(expression_system=None)

Return True if this numeric value is an expression

is_fixed()

A boolean indicating that this parameter is fixed.

is_indexed()

Return True if this numeric value is an indexed object

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

A boolean indicating that this is a parameter object.

is_potentially_variable()

Returns False because this object can never reference variables.

is_reference()

Return True if this object is a reference.

is_relational()

DEPRECATED.

Return True if this numeric 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()

A boolean indicating that this is a variable object.

polynomial_degree()

Always return zero because we always validate that the stored expression can never reference variables.

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 string representation consists of nested functions. Otherwise, the string representation is an infix algebraic equation. Defaults to False.

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

  • smap – A SymbolMap instance that stores string labels for non-constant nodes in the expression tree. Defaults to None.

  • compute_values (bool) – If True, then fixed expressions are evaluated and the string representation of the resulting value is returned.

Returns:

A string representation for the expression tree.

property active

The active status of this object.

property ctype

The object’s category type.

property fn

The function stored with this object

property local_name

The object’s local name within the context of its parent. Alias for obj.getname(fully_qualified=False).

property name

The object’s fully qualified name. Alias for obj.getname(fully_qualified=True).

property parent

The object’s parent (possibly None).

property storage_key

The object’s storage key within its parent