didppy.min
- didppy.min(x, y)
Returns an expression representing the smaller 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 smaller 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.min(var, 1).eval(model.target_state, model) 1