Ord#

class gamspy.Ord(set)[source]#

Bases: Operable

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

Parameters:
setSet | Alias
Parameters:

set (Set | 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()[source]#
Return type:

str