# class Gecode::SelectedSet::SelectedSetConstraintReceiver

SelectedSetConstraintReceiver contains all constraints that can be placed on a SelectedSetOperand.

Constraints are placed by calling Gecode::Operand#must (or any other of the variations defined in Operand), which produces a SelectedSetConstraintReceiver from which the desired constraint can be used.

#### Examples ¶ ↑

Constrains the sets in `set_enum`

that are selected by
`set_operand`

to be disjoint. This uses SetEnumOperand#[] and #disjoint.

set_enum[set_operand].must_be.disjoint

### Public Instance Methods

disjoint(options = {})
click to toggle source

Constrains the selected sets to be pairwise disjoint.

#### Examples ¶ ↑

# Constrains all sets selected by +set_enum[set]+ to be pairwise # disjoint. set_enum[set].must_be.disjoint

# File lib/gecoder/interface/constraints/selected_set/select.rb, line 51 def disjoint(options = {}) if @params[:negate] raise Gecode::MissingConstraintError, 'A negated disjoint constraint ' + 'is not implemented.' end if options.has_key? :reify raise ArgumentError, 'The disjoint constraint does not support the ' + 'reification option.' end @params.update Gecode::Set::Util.decode_options(options) @model.add_constraint Element::DisjointConstraint.new(@model, @params) end