Class: Gecode::Int::Domain::RangeDomainConstraint
- Inherits:
-
ReifiableConstraint
- Object
- Constraint
- ReifiableConstraint
- Gecode::Int::Domain::RangeDomainConstraint
- 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
-
#post ⇒ Object
:nodoc:.
Methods inherited from ReifiableConstraint
#&, #reification_var, #reification_var=, #|
Methods inherited from Constraint
Constructor Details
This class inherits a constructor from Gecode::Constraint
Instance Method Details
#post ⇒ Object
: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 Gecode::Raw::dom(@model.active_space, *params) end |