Class: Gecode::Constraints::Expression
- Inherits:
-
Object
- Object
- Gecode::Constraints::Expression
- Defined in:
- lib/gecoder/interface/constraints.rb
Overview
Describes a constraint expressions. An expression is produced by calling some form of must on a left hand side. The expression waits for a right hand side so that it can post the corresponding constraint.
Direct Known Subclasses
Bool::Expression, BoolEnum::Expression, CompositeExpression, Int::Expression, IntEnum::Expression, Set::Expression, Set::Operation::Expression, Set::Relation::ElementExpression, SetEnum::Expression
Instance Method Summary collapse
-
#initialize(model, params) ⇒ Expression
constructor
Constructs a new expression with the specified parameters.
Constructor Details
#initialize(model, params) ⇒ Expression
Constructs a new expression with the specified parameters. The parameters shoud at least contain the keys :lhs, and :negate.
Raises ArgumentError if any of those keys are missing.
262 263 264 265 266 267 268 269 270 |
# File 'lib/gecoder/interface/constraints.rb', line 262 def initialize(model, params) unless params.has_key?(:lhs) and params.has_key?(:negate) raise ArgumentError, 'Expression requires at least :lhs, ' + "and :negate as parameter keys, got #{params.keys.join(', ')}." end @model = model @params = params end |