ensure_symbols#

ams.opt.optzbase.ensure_symbols(func)[source]#

Decorator to ensure that symbols are generated before parsing. If not, it runs self.rtn.syms.generate_symbols().

Designed to be used on the parse method of the optimization elements (OptzBase) and optimization model (OModel), i.e., Var, Param, Constraint, Objective, and ExpressionCalc.

Parsing before symbol generation can give wrong results. Ensure that symbols are generated before calling the parse method.