selectConstraints()

This method selects all constraints matching a specified selector.

This page discusses:

Arguments

selector: Python callable object.

Return Value

Returns a list-like Python object containing all constraints matching the selector.

Each constraint in the data set is passed to the selector. The following example selects all constraints with the type LESS_THAN:

def lessThanTest(constraint):
    return constraint["type"] == "LESS_THAN"

ltConstraints = FormulationAPI.selectConstraints(lessThanTest)