Class: Gecode::Bool::Linear::LinearRelationConstraint
- Inherits:
-
ReifiableConstraint
- Object
- Constraint
- ReifiableConstraint
- Gecode::Bool::Linear::LinearRelationConstraint
- Defined in:
- lib/gecoder/interface/constraints/bool/linear.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#post ⇒ Object
:nodoc:.
Methods inherited from ReifiableConstraint
#&, #reification_var, #reification_var=, #|
Methods inherited from Constraint
Constructor Details
This class inherits a constructor from Gecode::Constraint
Instance Method Details
#post ⇒ Object
: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, *) else final_exp.post(@model.active_space, relation_type, reif_var, *) end end |