def _add_constraints(self, relation):
        """Add the given relation as one or more constraints

        Return a list of the names of the constraints added.
        """
        expression = relation.expression
        names = []
        for value_set in expression.value_sets():
            values = ((self._variables[variable], value)
                      for variable, value in value_set)
            constr_name = next(self._constr_names)
            sense = self.CONSTR_SENSE_MAP[relation.sense]
            self._p.add_linear_constraint(
                sense=sense, values=values, rhs=-expression.offset,
                name=constr_name)
            names.append(constr_name)

        return names
def _add_constraints ( self , relation ) : expression = relation . expression names = [ ] for value_set in expression . value_sets ( ) : values = ( ( self . _variables [ variable ] , value ) for variable , value in value_set ) constr_name = next ( self . _constr_names ) sense = self . CONSTR_SENSE_MAP [ relation . sense ] self . _p . add_linear_constraint ( sense = sense , values = values , rhs = - expression . offset , name = constr_name ) names . append ( constr_name ) return names
Add the given relation as one or more constraints

        Return a list of the names of the constraints added.