Class: Gecode::Constraint
- Inherits:
-
Object
- Object
- Gecode::Constraint
- Defined in:
- lib/gecoder/interface/constraints.rb
Overview
Base class for all constraints.
Direct Known Subclasses
BlockConstraint, 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, SelectedSet::Element::DisjointConstraint, Set::Cardinality::CardinalityConstraint, Set::Channel::ChannelConstraint, Set::Connection::IncludeConstraint, Set::Operation::OperationConstraint, SetElements::Relation::RelationConstraint, SetEnum::Channel::IntEnumChannelConstraint, SetEnum::Distinct::AtMostOneConstraint
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.
216 217 218 219 |
# File 'lib/gecoder/interface/constraints.rb', line 216 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.
223 224 225 |
# File 'lib/gecoder/interface/constraints.rb', line 223 def post raise NotImplementedError, 'Abstract method has not been implemented.' end |