Ord#

class gamspy.Ord(symbol: Set | Alias)[source]#

Bases: Operable

The operator ord may be used only with one-dimensional sets.

Parameters:
setSet | Alias

Methods

gamsRepr()

Representation of the Ord operation in GAMS language.

latexRepr()

Representation of Ord function in Latex.

Examples

>>> import gamspy as gp
>>> m = gp.Container()
>>> t = gp.Set(m, name="t", description="time periods", records=[str(x) for x in range(1985, 1996)])
>>> val = gp.Parameter(m, name="val", domain=[t])
>>> val[t] = gp.Ord(t)
gamsRepr() str[source]#

Representation of the Ord operation in GAMS language.

Returns:
str

Examples

>>> from gamspy import Container, Set, Ord
>>> m = Container()
>>> i = Set(m, "i", records=['i1','i2', 'i3'])
>>> Ord(i).gamsRepr()
'ord(i)'
latexRepr() str[source]#

Representation of Ord function in Latex.

Returns:
str