Sha256: 176401434be3514651428dc8b8110555551eb7da96da68b429ffa408389f1d2f

Contents?: true

Size: 1 KB

Versions: 6

Compression:

Stored size: 1 KB

Contents

module Gecode
  module BoolEnumMethods
    include Gecode::Constraints::LeftHandSideMethods
    
    private
    
    # Produces an expression for the lhs module.
    def expression(params)
      params.update(:lhs => self)
      Constraints::BoolEnum::Expression.new(@model, params)
    end
  end
  
  # A module containing constraints that have enumerations of boolean variables 
  # as left hand side.
  module Constraints::BoolEnum
    # Expressions with bool enums as left hand sides.
    class Expression < Gecode::Constraints::Expression #:nodoc:
      # Raises TypeError unless the left hand side is a bool enum.
      def initialize(model, params)
        super
        
        unless params[:lhs].respond_to? :to_bool_var_array
          raise TypeError, 'Must have bool enum as left hand side.'
        end
      end
    end
  end
end

require 'gecoder/interface/constraints/bool_enum/relation'
require 'gecoder/interface/constraints/bool_enum/extensional'
require 'gecoder/interface/constraints/bool_enum/channel'

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gecoder-with-gecode-0.8.3-mswin32 lib/gecoder/interface/constraints/bool_enum_constraints.rb
gecoder-with-gecode-0.8.2-mswin32 lib/gecoder/interface/constraints/bool_enum_constraints.rb
gecoder-0.8.2 lib/gecoder/interface/constraints/bool_enum_constraints.rb
gecoder-0.8.3 lib/gecoder/interface/constraints/bool_enum_constraints.rb
gecoder-with-gecode-0.8.2 lib/gecoder/interface/constraints/bool_enum_constraints.rb
gecoder-with-gecode-0.8.3 lib/gecoder/interface/constraints/bool_enum_constraints.rb