Class: Gecode::Int::Linear::LinearRelationConstraint

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



65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/gecoder/interface/constraints/int/linear.rb', line 65

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