Class: Gecode::IntEnum::Extensional::TupleConstraint

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

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Constraint

#initialize

Constructor Details

This class inherits a constructor from Gecode::Constraint

Instance Method Details

#postObject

:nodoc:



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/gecoder/interface/constraints/int_enum/extensional.rb', line 162

def post
  # Bind lhs.
  lhs = @params[:lhs].to_int_enum.bind_array

  # Create the tuple set.
  tuple_set = Gecode::Raw::TupleSet.new
  @params[:tuples].each do |tuple|
    tuple_set.add tuple
  end
  tuple_set.finalize

  # Post the constraint.
  Gecode::Raw::extensional(@model.active_space, lhs, tuple_set, 
    *propagation_options)
end