Class: Gecode::Int::Domain::RangeDomainConstraint

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

Overview

Range domain constraints specify that an integer operand must be contained within a specified range of integers.

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::Constraint

Instance Method Details

#postObject

:nodoc:



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/gecoder/interface/constraints/int/domain.rb', line 49

def post
  var, domain, reif_var = @params.values_at(:lhs, :domain, :reif)
    
  (params = []) << var.to_int_var.bind
  last = domain.last
  last -= 1 if domain.exclude_end?
  params << domain.first << last
  params << reif_var.to_bool_var.bind if reif_var.respond_to? :to_bool_var
  params.concat propagation_options
  
  Gecode::Raw::dom(@model.active_space, *params)
end