ams.opt.omodel.Objective#

class ams.opt.omodel.Objective(name: str | None = None, e_str: str | None = None, info: str | None = None, unit: str | None = None, sense: str | None = 'min')[source]#

Base class for objective functions.

This class serves as a template for defining objective functions. Each instance of this class represents a single objective function that can be minimized or maximized depending on the sense ('min' or 'max').

Parameters:
namestr, optional

A user-defined name for the objective function.

e_strstr, optional

A mathematical expression representing the objective function.

infostr, optional

Additional informational text about the objective function.

sensestr, optional

The sense of the objective function, default to 'min'. min for minimization and max for maximization.

Attributes:
vNoneType

Return the CVXPY objective value.

rtnams.routines.Routine

The owner routine instance.

__init__(name: str | None = None, e_str: str | None = None, info: str | None = None, unit: str | None = None, sense: str | None = 'min')[source]#

Methods

parse([no_code])

Parse the objective function.

Attributes

class_name

Return the class name

n

Return the number of elements.

shape

Return the shape.

size

Return the size.

v

Return the CVXPY objective value.

v2

Return the calculated objective value.