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:
v
NoneTypeReturn 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
Return the class name
Return the number of elements.
Return the shape.
Return the size.
Return the CVXPY objective value.
Return the calculated objective value.