Ord#

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

Bases: Operable

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

Parameters:
setSet | Alias

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)

Methods

gamsRepr

gamsRepr() str[source]#