Class: Gecode::Constraints::Int::Channel::ChannelConstraint

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

Overview

Describes a channel constraint that constrains an integer variable to be 1 if a boolean variable is true, and 0 when the boolean variable is false. Does not support negation nor reification.

Examples

# The integer variable +x+ must be one exactly when the boolean 
# variable +bool+ is true.
x.must == bool

Instance Method Summary collapse

Methods inherited from Constraint

#initialize

Constructor Details

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

Instance Method Details

#postObject



54
55
56
57
58
# File 'lib/gecoder/interface/constraints/int/channel.rb', line 54

def post
  lhs, rhs = @params.values_at(:lhs, :rhs)
  Gecode::Raw::channel(@model.active_space, lhs.bind, rhs.bind,
    *propagation_options)
end