Class: Gecode::Constraints::BoolEnum::Channel::ChannelConstraint
- Inherits:
-
Constraint
- Object
- Constraint
- Gecode::Constraints::BoolEnum::Channel::ChannelConstraint
- Defined in:
- lib/gecoder/interface/constraints/bool_enum/channel.rb
Overview
Describes a channel constraint that “channels” an enumeration of boolean variables with an integer variable. This constrains the integer variable to take value i exactly when the variable at index i in the boolean enumeration is true and the others are false.
Neither reification nor negation is supported. The int variable and the enumeration can be interchanged.
Examples
# Constrains the enumeration called option_is_selected
to be false in the # first four positions and have exactly one true variable in the other. option_is_selected.must.channel selected_option_index selected_option_index.must_be > 3
# Constrains the enumeration called option_is_selected
to be false in the # first five positions and have exactly one true variable in the other. selected_option_index.must.channel(option_is_selected, :offset => 1) selected_option_index.must_be > 3
Instance Method Summary collapse
Methods inherited from Constraint
Constructor Details
This class inherits a constructor from Gecode::Constraints::Constraint