Class: Gecode::Constraints::SetEnum::Selection::DisjointConstraint

Inherits:
Constraint
  • Object
show all
Defined in:
lib/gecoder/interface/constraints/set_enum/selection.rb

Overview

Describes a disjoint constraint, which constrains all set variable is an enumeration, at the position specified by a set variable, to be disjoint.

Does not support negation nor reification.

Examples

# The set variable located in the enumeration +sets+ at positions 
# described by +disjoint_set_positions+ must be disjoint.
sets[disjoint_set_positions].must_be.disjoint

Instance Method Summary collapse

Methods inherited from Constraint

#initialize

Constructor Details

This class inherits a constructor from Gecode::Constraints::Constraint

Instance Method Details

#postObject



211
212
213
214
215
# File 'lib/gecoder/interface/constraints/set_enum/selection.rb', line 211

def post
  enum, indices = @params.values_at(:lhs, :indices)
  Gecode::Raw.selectDisjoint(@model.active_space, enum.to_set_var_array,
    indices.bind)
end