Class: Gecode::Constraints::Int::Domain::NonRangeDomainConstraint

Inherits:
ReifiableConstraint show all
Defined in:
lib/gecoder/interface/constraints/int/domain.rb

Overview

Describes a non-range domain constraint.

Instance Method Summary collapse

Methods inherited from ReifiableConstraint

#&, #reification_var, #reification_var=, #|

Methods inherited from Constraint

#initialize

Constructor Details

This class inherits a constructor from Gecode::Constraints::Constraint

Instance Method Details

#postObject



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/gecoder/interface/constraints/int/domain.rb', line 34

def post
  space = @model.active_space

  var, domain, reif_var, strength = @params.values_at(:lhs, :domain, 
    :reif, :strength)
  domain = domain.to_a
  
  (params = []) << var.bind
  params << Gecode::Raw::IntSet.new(domain, domain.size)
  params << reif_var.bind if reif_var.respond_to? :bind
  params << strength
  Gecode::Raw::dom(space, *params)
end