class Gecode::IntEnum::Count::CountConstraint

Public Instance Methods

post() click to toggle source
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/int_enum/count.rb, line 48
def post
  enum, element, relation_type, rhs = 
    @params.values_at(:enum, :element, :relation_type, :rhs)
  
  # Bind variables if needed.
  unless element.kind_of? Fixnum
    element = element.to_int_var.bind
  end
  unless rhs.kind_of? Fixnum
    rhs = rhs.to_int_var.bind
  end
  
  # Post the constraint to gecode.
  Gecode::Raw::count(@model.active_space, enum.to_int_enum.bind_array, 
    element, relation_type, rhs, *propagation_options)
end