addConstraint()

This method adds a constraint, specified by a dictionary-like object containing paramId, type, and values, to the formulation.

This page discusses:

Arguments

  • paramId: String identifying the parameter for which the constraint will be defined.
  • type: Type of constraint to be added. Valid types are LESS_THAN, GREATER_THAN, and IN_RANGE.
  • boundValue: Bound value for LESS_THAN and GREATER_THAN constraints. Invalid for other constraint types.
  • range: List containing exactly two numbers defining the range for IN_RANGE constraints. Invalid for other constraint types.

Return Value

None.

paramId is the id attribute on the parameter objects used by methods in the Parameter API.