Sor#

class gamspy.Sor(domain: Set | Alias | ImplicitSet | Sequence[Set | Alias] | Domain | Condition, expression: Operation | Expression | ImplicitParameter | ImplicitVariable | int | bool)[source]#

Bases: Operation

Represents a sor operation over a domain.

Parameters:
domainSet | Alias | Sequence[Set | Alias], Domain, Expression
expression(

Expression | ImplicitVariable | ImplicitParameter | int | bool | Variable | Parameter | Operation

)

Methods

gamsRepr()

Representation of the Sor operation in GAMS language.

latexRepr()

Representation of this operation in Latex.

Examples

>>> import gamspy as gp
>>> m = gp.Container()
>>> i = gp.Set(m, "i", records=['i1','i2', 'i3'])
>>> p = gp.Parameter(m, domain=i)
>>> p[i] = gp.math.uniformInt(0,1)
>>> result = gp.Parameter(m)
>>> result[:] = gp.Sor(i, p[i])
gamsRepr()[source]#

Representation of the Sor operation in GAMS language.

Returns:
str

Examples

>>> from gamspy import Container, Set, Parameter, Variable, Sor
>>> m = Container()
>>> i = Set(m, "i", records=['i1','i2', 'i3'])
>>> v = Variable(m, "v", domain=i, type="binary")
>>> Sor(i, v[i]).gamsRepr()
'sor(i,v(i))'
latexRepr() str#

Representation of this operation in Latex.

Returns:
str