Sha256: 154a8ff0590299d437f6b0e85356b232ca11e7587929d82b494f7820f0d8cb0e

Contents?: true

Size: 1.04 KB

Versions: 16

Compression:

Stored size: 1.04 KB

Contents

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

require 'gecoder/interface/constraints/set_enum/channel'
require 'gecoder/interface/constraints/set_enum/distinct'
require 'gecoder/interface/constraints/set_enum/selection'
require 'gecoder/interface/constraints/set_enum/operation'

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
gecoder-with-gecode-0.8.3-mswin32 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-with-gecode-0.8.2-mswin32 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-with-gecode-0.8.1-mswin32 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-with-gecode-0.8.0-mswin32 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-with-gecode-0.7.1-mswin32 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-0.8.3 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-0.7.1 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-0.8.2 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-0.8.0 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-0.8.1 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-0.7.0 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-with-gecode-0.7.1 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-with-gecode-0.8.0 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-with-gecode-0.8.1 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-with-gecode-0.8.2 lib/gecoder/interface/constraints/set_enum_constraints.rb
gecoder-with-gecode-0.8.3 lib/gecoder/interface/constraints/set_enum_constraints.rb