Class: Gecode::Bool::Linear::LinearRelationConstraint

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



103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/gecoder/interface/constraints/bool/linear.rb', line 103

def post
  lhs, rhs, relation_type, reif_var = 
    @params.values_at(:lhs, :rhs, :relation_type, :reif)
  reif_var = reif_var.to_bool_var.bind if reif_var.respond_to? :to_bool_var
  final_exp = (lhs.to_minimodel_lin_exp - rhs.to_minimodel_lin_exp)
  if reif_var.nil?
    final_exp.post(@model.active_space, relation_type, 
      *propagation_options)
  else
    final_exp.post(@model.active_space, relation_type, reif_var, 
      *propagation_options)
  end
end