Card#

class gamspy.Card(symbol)[source]#

Bases: Operable

The operator card may be used with any symbol and returns its number of records.

Parameters:
symbolSet | Alias | Parameter | Variable | Equation | Model
Parameters:

symbol (Set | Alias | Parameter) –

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)],
>>> )
>>> s = gp.Parameter(m, name="s")
>>> s[...] = gp.Card(t)

Methods

gamsRepr

gamsRepr()[source]#
Return type:

str