Ord#
- class gamspy.Ord(symbol: Set | Alias)[source]#
Bases:
OperableThe operator ord may be used only with one-dimensional sets.
- Parameters:
- setSet | Alias
Methods
gamsRepr()Representation of the Ord operation in GAMS language.
Representation of Ord function in Latex.
Representation of Ord function in mathematical notation with Unicode characters.
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)'