grid.max
- grid.max(array)[source]
Return an expression evaluating to the element-wise maximum of inputs.
- Parameters:
array (list of Expr, Var, or numeric) – Inputs to compare. Python literals are wrapped automatically.
- Returns:
Expression representing
max(array).- Return type:
Expr
Examples
>>> import grid >>> model = grid.RoutingModel() >>> vehicle = model.add_vehicle_type(id=0, count=1, capacity=10) >>> load = vehicle.add_integer_var(initial_value=10) >>> grid.max([load, 0]) Expr(max, Var_0, Const_0, integer)