ams.opt.objective.Objective#
- class ams.opt.objective.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:
vNoneTypeReturn the CVXPY objective value.
- rtnams.routines.Routine
The owner routine instance.
- codestr
The code string for the objective function.
- __init__(name: str | None = None, e_str: str | None = None, info: str | None = None, unit: str | None = None, sense: str | None = 'min')[source]#
Methods
Attributes