Class: Gecode::ReifiableConstraint
- Inherits:
-
Constraint
- Object
- Constraint
- Gecode::ReifiableConstraint
- Defined in:
- lib/gecoder/interface/constraints/reifiable_constraints.rb
Overview
Base class for all reifiable constraints.
Direct Known Subclasses
Bool::BooleanConstraint, Bool::Linear::LinearRelationConstraint, Int::Domain::EnumDomainConstraint, Int::Domain::RangeDomainConstraint, Int::Linear::LinearRelationConstraint, Int::Relation::RelationConstraint, IntEnum::Count::CountConstraint, IntEnum::Sort::SortConstraint, Set::Domain::DomainConstraint, Set::Domain::EqualityDomainConstraint, Set::Relation::EqualityRelationConstraint, Set::Relation::RelationConstraint
Instance Method Summary collapse
-
#&(constraint) ⇒ Object
Produces a conjunction of two reifiable constraints, producing a new reifiable constraint.
-
#reification_var ⇒ Object
Gets the reification operand of the constraint, nil if none exists.
-
#reification_var=(new_var) ⇒ Object
Sets the reification operand of the constraint, nil if none should be used.
-
#|(constraint) ⇒ Object
Produces a disjunction of two reifiable constraints, producing a new reifiable constraint.
Methods inherited from Constraint
Constructor Details
This class inherits a constructor from Gecode::Constraint
Instance Method Details
#&(constraint) ⇒ Object
Produces a conjunction of two reifiable constraints, producing a new reifiable constraint.
26 27 28 29 30 31 |
# File 'lib/gecoder/interface/constraints/reifiable_constraints.rb', line 26 def &(constraint) with_reification_operands(constraint) do |b1, b2| # Create the conjunction constraint. (b1 & b2).must_be.true end end |
#reification_var ⇒ Object
Gets the reification operand of the constraint, nil if none exists.
5 6 7 |
# File 'lib/gecoder/interface/constraints/reifiable_constraints.rb', line 5 def reification_var @params[:reif] end |
#reification_var=(new_var) ⇒ Object
Sets the reification operand of the constraint, nil if none should be used.
11 12 13 |
# File 'lib/gecoder/interface/constraints/reifiable_constraints.rb', line 11 def reification_var=(new_var) @params[:reif] = new_var end |
#|(constraint) ⇒ Object
Produces a disjunction of two reifiable constraints, producing a new reifiable constraint.
17 18 19 20 21 22 |
# File 'lib/gecoder/interface/constraints/reifiable_constraints.rb', line 17 def |(constraint) with_reification_operands(constraint) do |b1, b2| # Create the disjunction constraint. (b1 | b2).must_be.true end end |