grid.log

grid.log(x, y)[source]

Return an expression evaluating to a logarithm.

Parameters:
  • x (Expr, Var, or numeric) – Argument of the logarithm.

  • y (Expr, Var, or numeric) – Base of the logarithm.

Returns:

Float-typed logarithm expression.

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.log(load, 2)
Expr(log, Var_0, Const_2, float)