objective

(class from pyomo.core.kernel.objective)

class pyomo.core.kernel.objective.objective(expr=None, sense=ObjectiveSense.minimize)[source]

Bases: IObjective

An optimization objective.

__init__(expr=None, sense=ObjectiveSense.minimize)[source]

Methods

__init__([expr, sense])

activate()

Activate this object.

arg(i)

clone()

Return a clone of this expression (no-op).

create_node_with_local_data(values)

Construct an expression after constructing the contained expression.

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 whether this expression is constant.

is_expression_type([expression_system])

A boolean indicating whether this in an expression.

is_fixed()

A boolean indicating whether this expression 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_minimizing()

is_named_expression_type()

A boolean indicating whether this in a named expression.

is_numeric_type()

Return True if this class is a Pyomo numeric object

is_parameter_type()

A boolean indicating whether this expression is a parameter object.

is_potentially_variable()

A boolean indicating whether this expression can reference variables.

is_reference()

Return True if this object is a reference.

is_relational()

DEPRECATED.

is_variable_type()

A boolean indicating whether this expression is a variable object.

nargs()

Length of self._nargs()

polynomial_degree()

The polynomial degree of the stored expression.

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

Convert this expression into a string.

Attributes

PRECEDENCE

active

The active status of this object.

args

A tuple of subexpressions involved in this expressions operation.

ctype

The object's category type.

expr

The stored expression

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

sense

The optimization direction for the objective (minimize or maximize)

storage_key

The object's storage key within its parent

Member Documentation

activate()

Activate this object.

clone()

Return a clone of this expression (no-op).

create_node_with_local_data(values)

Construct an expression after constructing the contained expression.

This class provides a consistent interface for constructing a node, which is used in tree visitor scripts.

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 whether this expression is constant.

is_expression_type(expression_system=None)

A boolean indicating whether this in an expression.

is_fixed()

A boolean indicating whether this expression 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()

A boolean indicating whether this in a named expression.

is_numeric_type()

Return True if this class is a Pyomo numeric object

is_parameter_type()

A boolean indicating whether this expression is a parameter object.

is_potentially_variable()

A boolean indicating whether this expression can 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 whether this expression is a variable object.

nargs()

Length of self._nargs()

polynomial_degree()

The polynomial degree of the stored expression.

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

Convert this expression into a string.

property active

The active status of this object.

property args

A tuple of subexpressions involved in this expressions operation.

property ctype

The object’s category type.

property expr

The stored expression

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 sense

The optimization direction for the objective (minimize or maximize)

property storage_key

The object’s storage key within its parent