Smax#
- class gamspy.Smax(domain: Set | Alias | tuple[Set | Alias] | Domain | Expression, expression: Expression | int | bool)[source]#
Bases:
OperationRepresents a smax operation over a domain.
- Parameters:
- domainSet | Alias | Tuple[Set | Alias], Domain, Expression
- expression(
Expression | ImplicitVariable | ImplicitParameter | int | bool | Variable | Parameter | Operation
)
Methods
gamsRepr()Representation of the Smax 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']) >>> v = gp.Variable(m, "v") >>> e = gp.Equation(m, "e", type="eq") >>> p = gp.Parameter(m, "p", domain=[i], records=[("i1", 1), ("i2", 2), ("i3", 4)]) >>> e[...] = gp.Smax(i, p[i]) <= v
- gamsRepr()[source]#
Representation of the Smax operation in GAMS language.
- Returns:
- str
Examples
>>> from gamspy import Container, Set, Parameter, Variable, Smax >>> m = Container() >>> i = Set(m, "i", records=['i1','i2', 'i3']) >>> c = Parameter(m, "c", domain=i) >>> v = Variable(m, "v", domain=i) >>> Smax(i, c[i]*v[i]).gamsRepr() 'smax(i,(c(i) * v(i)))'