Class: Gecode::Int::Relation::RelationConstraint

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

Overview

:nodoc:

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:



125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/gecoder/interface/constraints/int/relation.rb', line 125

def post
  # Fetch the parameters to Gecode.
  lhs, relation, rhs, reif_var = 
    @params.values_at(:lhs, :relation_type, :rhs, :reif)
    
  rhs = rhs.to_int_var.bind if rhs.respond_to? :to_int_var
  if reif_var.nil?
    Gecode::Raw::rel(@model.active_space, lhs.to_int_var.bind, 
      relation, rhs, *propagation_options)
  else
    Gecode::Raw::rel(@model.active_space, lhs.to_int_var.bind, 
      relation, rhs, reif_var.to_bool_var.bind, *propagation_options)
  end
end