Sha256: 7b14604659126619f610fbe6c532188f63f8ab96116d20ae7e81c87da914e01f

Contents?: true

Size: 662 Bytes

Versions: 3

Compression:

Stored size: 662 Bytes

Contents

module Gecode::Constraints::Bool
  class Expression
    alias_method :pre_channel_equals, :==
    
    # Constrains the boolean variable to be equal to the specified integer 
    # variable.
    def ==(int, options = {})
      unless @params[:lhs].kind_of?(Gecode::FreeBoolVar) and 
          int.kind_of?(Gecode::FreeIntVar)
        return pre_channel_equals(int, options)
      end
      
      # Provide commutivity to the corresponding int variable constraint.
      if @params[:negate]
        int.must_not.equal(@params[:lhs], options)
      else
        int.must.equal(@params[:lhs], options)
      end
    end
    
    alias_comparison_methods
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
gecoder-with-gecode-0.8.2-mswin32 lib/gecoder/interface/constraints/bool/channel.rb
gecoder-0.8.2 lib/gecoder/interface/constraints/bool/channel.rb
gecoder-with-gecode-0.8.2 lib/gecoder/interface/constraints/bool/channel.rb