Class: Gecode::Set::Domain::EqualityDomainConstraint

Inherits:
ReifiableConstraint show all
Defined in:
lib/gecoder/interface/constraints/set/domain.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
139
# File 'lib/gecoder/interface/constraints/set/domain.rb', line 125

def post
  var, domain, 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 = []) << var.to_set_var.bind
  params << rel_type
  params << Gecode::Util.constant_set_to_params(domain)
  params << reif_var.to_bool_var.bind if reif_var.respond_to? :to_bool_var
  Gecode::Raw::dom(@model.active_space, *params.flatten)
end