get_active_objectives

(function from pyomo.contrib.solver.solvers.knitro.utils)

pyomo.contrib.solver.solvers.knitro.utils.get_active_objectives(block: BlockData) list[ObjectiveData][source]

Retrieve all active ObjectiveData objects from a Pyomo Block.

Parameters:

block (BlockData) – The Pyomo block to search for objectives.

Returns:

A sorted list of all active objectives in the block.

Return type:

list[ObjectiveData]