Class: Gecode::Constraints::Set::Expression
- Inherits:
-
Expression
- Object
- Expression
- Gecode::Constraints::Set::Expression
- Defined in:
- lib/gecoder/interface/constraints/set_var_constraints.rb,
lib/gecoder/interface/constraints/set/domain.rb,
lib/gecoder/interface/constraints/set/channel.rb,
lib/gecoder/interface/constraints/set/relation.rb
Overview
An expression with a set as left hand side.
Direct Known Subclasses
Gecode::Constraints::SetEnum::Selection::SetAccessExpression
Instance Method Summary collapse
-
#channel(bool_enum, options = {}) ⇒ Object
Adds a channel constraint on the set variable with the specified enum of boolean variables.
Methods inherited from Expression
Constructor Details
This class inherits a constructor from Gecode::Constraints::Expression
Instance Method Details
#channel(bool_enum, options = {}) ⇒ Object
Adds a channel constraint on the set variable with the specified enum of boolean variables.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gecoder/interface/constraints/set/channel.rb', line 5 def channel(bool_enum, = {}) if @params[:negate] raise Gecode::MissingConstraintError, 'A negated channel constraint ' + 'is not implemented.' end if .has_key? :reify raise ArgumentError, 'The channel constraint does not support the ' + 'reification option.' end unless bool_enum.respond_to? :to_bool_var_array raise TypeError, 'Expected an enum of bool variables, ' + "got #{bool_enum.class}." end @params.update(:rhs => bool_enum) @params.update Gecode::Constraints::Set::Util.() @model.add_constraint Channel::ChannelConstraint.new(@model, @params) end |