didppy.max
- didppy.max(x, y)
Returns an expression representing the greater value.
- Parameters:
x (ElementExpr, ElementVar, ElementResourceVar, IntExpr, IntVar, IntResourceVar, FloatExpr, FloatVar, FloatResourceVar, SetExpr, SetConst, SetVar, int, or float) – First input.
y (ElementExpr, ElementVar, ElementResourceVar, IntExpr, IntVar, IntResourceVar, FloatExpr, FloatVar, FloatResourceVar, SetExpr, SetConst, SetVar, int, or float) – Second input.
- Returns:
The greater value.
- Return type:
ElementExpr, IntExpr, FloatExpr, or SetExpr
- Raises:
TypeError – If the types of
x
andy
mismatch.
Examples
>>> import didppy as dp >>> model = dp.Model() >>> var = model.add_int_var(target=2) >>> dp.max(var, 1).eval(model.target_state, model) 2