Python builtin overwrites (cpmpy.expressions.python_builtins)
Overwrites a number of python built-ins, so that they work over variables as expected.
List of functions
- nosignatures:
all any max min sum abs
- cpmpy.expressions.python_builtins.abs(element)[source]
Overwrites the python built-in abs function, to support decision variables.
if the element given is not a CPMpy expression, the built-in is called else an Absolute functional global constraint is constructed.
- cpmpy.expressions.python_builtins.all(iterable)[source]
Overwrites python built-in all function, to support decision variables.
if iterable contains any Expression, then returns an Operator(“and”, iterable) otherwise returns whether all of the arguments are true
- cpmpy.expressions.python_builtins.any(iterable)[source]
Overwrites python built-in any function, to support decision variables.
if iterable contains an Expression, then returns an Operator(“or”, iterable) otherwise returns whether any of the arguments is true
- cpmpy.expressions.python_builtins.max(*iterable, **kwargs)[source]
Overwrites the python built-in max function, to support decision variables.
if iterable does not contain CPMpy expressions, the built-in is called else a Maximum functional global constraint is constructed; no keyword arguments are supported in that case
- cpmpy.expressions.python_builtins.min(*iterable, **kwargs)[source]
Overwrites the python built-in min function, to support decision variables.
if iterable does not contain CPMpy expressions, the built-in is called else a Minimum functional global constraint is constructed; no keyword arguments are supported in that case