Package

(class from pyomo.contrib.solver.solvers.knitro.package)

class pyomo.contrib.solver.solvers.knitro.package.Package[source]

Bases: object

Manages the global KNITRO license context and provides utility methods for license handling.

This class handles license initialization, release, context creation, version reporting, and license availability checks for the KNITRO solver.

__init__()

Methods

__init__()

check_availability()

Check if the KNITRO solver and license are available.

create_context()

Create a new KNITRO context using the global license context.

get_version()

Get the version of the KNITRO solver as a tuple.

initialize_license()

Initialize the global KNITRO license context if not already initialized.

release_license()

Release the global KNITRO license context if it exists.

Member Documentation

static check_availability() Availability[source]

Check if the KNITRO solver and license are available.

Returns:

The availability status (FullLicense, BadLicense, NotFound).

Return type:

Availability

static create_context()[source]

Create a new KNITRO context using the global license context.

Returns:

The new KNITRO context object.

static get_version() tuple[int, int, int] | None[source]

Get the version of the KNITRO solver as a tuple.

Returns:

The (major, minor, patch) version of KNITRO or None if KNITRO version could not be determined.

Return type:

tuple[int, int, int]

static initialize_license()[source]

Initialize the global KNITRO license context if not already initialized.

Returns:

The KNITRO license context object.

static release_license() None[source]

Release the global KNITRO license context if it exists.