ams.opt.expression.Expression#

class ams.opt.expression.Expression(name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, e_str: str | None = None, model: str | None = None, src: str | None = None, vtype: str | None = <class 'float'>, horizon: str | None = None)[source]#

Base class for expressions used in a routine.

Parameters:
namestr, optional

Expression name. One should typically assigning the name directly because it will be automatically assigned by the model. The value of name will be the symbol name to be used in expressions.

tex_namestr, optional

LaTeX-formatted variable symbol. Defaults to the value of name.

infostr, optional

Descriptive information

unitstr, optional

Unit

e_strstr, optional

Expression string

modelstr, optional

Name of the owner model or group.

srcstr, optional

Source expression name

vtypetype, optional

Value type

horizonams.routines.RParam, optional

Horizon

__init__(name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, e_str: str | None = None, model: str | None = None, src: str | None = None, vtype: str | None = <class 'float'>, horizon: str | None = None)[source]#

Methods

evaluate(*args, **kwargs)

get_all_idxes()

Return all the indexes of this item.

get_idx()

parse(*args, **kwargs)

Attributes

class_name

Return the class name

e

Return the calculated expression value.

n

Return the number of elements.

shape

Return the shape.

size

Return the size.

v

Return the CVXPY expression value.