Class: Gecode::Constraints::Constraint
- Inherits:
-
Object
- Object
- Gecode::Constraints::Constraint
- Defined in:
- lib/gecoder/interface/constraints.rb
Overview
Base class for all constraints.
Direct Known Subclasses
BoolEnum::Channel::ChannelConstraint, BoolEnum::Extensional::RegexpConstraint, BoolEnum::Extensional::TupleConstraint, Int::Channel::ChannelConstraint, IntEnum::Channel::ChannelConstraint, IntEnum::Distinct::DistinctConstraint, IntEnum::Equality::EqualityConstraint, IntEnum::Extensional::RegexpConstraint, IntEnum::Extensional::TupleConstraint, IntEnum::Sort::SortConstraintWithOptions, ReifiableConstraint, Set::Cardinality::CardinalityConstraint, Set::Channel::ChannelConstraint, Set::Operation::OperationConstraint, Set::Relation::ElementRelationConstraint, SetEnum::Channel::IntChannelConstraint, SetEnum::Distinct::AtMostOneConstraint, SetEnum::Selection::DisjointConstraint
Instance Method Summary collapse
-
#initialize(model, params) ⇒ Constraint
constructor
Creates a constraint with the specified parameters, bound to the specified model.
-
#post ⇒ Object
Posts the constraint, adding it to the model.
Constructor Details
#initialize(model, params) ⇒ Constraint
Creates a constraint with the specified parameters, bound to the specified model.
482 483 484 485 |
# File 'lib/gecoder/interface/constraints.rb', line 482 def initialize(model, params) @model = model @params = params.clone end |
Instance Method Details
#post ⇒ Object
Posts the constraint, adding it to the model. This is an abstract method and should be overridden by all sub-classes.
489 490 491 |
# File 'lib/gecoder/interface/constraints.rb', line 489 def post raise NoMethodError, 'Abstract method has not been implemented.' end |