as_boolean

(function from pyomo.core.expr.boolean_value)

pyomo.core.expr.boolean_value.as_boolean(obj)[source]

A function that converts its argument to a Pyomo Boolean (logical) object.

If obj is a Pyomo logical value (usually a BooleanValue subclass), then obj is returned. If obj is in native_logical_types, then the value is wrapped in a BooleanConstant and returned.

Parameters:

obj (The value to process and return / convert.)

Raises:

TypeError – if obj is not a logical value: