Class: Gecode::Set::Relation::EqualityRelationConstraint

Inherits:
ReifiableConstraint show all
Defined in:
lib/gecoder/interface/constraints/set/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:



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/gecoder/interface/constraints/set/relation.rb', line 120

def post
  lhs, rhs, reif_var, negate = @params.values_at(:lhs, :rhs, :reif, 
    :negate)
  if negate
    rel_type = Gecode::Util::NEGATED_SET_RELATION_TYPES[:==]
  else
    rel_type = Gecode::Util::SET_RELATION_TYPES[:==]
  end
  
  (params = []) << lhs.to_set_var.bind
  params << rel_type
  params << rhs.to_set_var.bind
  if reif_var.respond_to? :to_bool_var
    params << reif_var.to_bool_var.bind 
  end
  Gecode::Raw::rel(@model.active_space, *params)
end