Class: Gecode::SetEnum::Operation::OperationSetOperand
- Inherits:
-
Gecode::Set::ShortCircuitEqualityOperand
- Object
- Gecode::Set::ShortCircuitEqualityOperand
- Gecode::SetEnum::Operation::OperationSetOperand
- Defined in:
- lib/gecoder/interface/constraints/set_enum/operation.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Gecode::Set::ShortCircuitEqualityOperand
Instance Method Summary collapse
- #constrain_equal(set_operand, constrain_domain, propagation_options) ⇒ Object
-
#initialize(model, enum, operator) ⇒ OperationSetOperand
constructor
:nodoc:.
Methods inherited from Gecode::Set::ShortCircuitEqualityOperand
#construct_receiver, #to_set_var
Methods included from Gecode::Set::SetOperand
#disjoint_union, #elements, #intersection, #method_missing, #minus, #size, #union
Methods included from Operand
Constructor Details
#initialize(model, enum, operator) ⇒ OperationSetOperand
:nodoc:
48 49 50 51 52 |
# File 'lib/gecoder/interface/constraints/set_enum/operation.rb', line 48 def initialize(model, enum, operator) super model @enum = enum @operator = operator end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Gecode::Set::SetOperand
Instance Method Details
#constrain_equal(set_operand, constrain_domain, propagation_options) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/gecoder/interface/constraints/set_enum/operation.rb', line 54 def constrain_equal(set_operand, constrain_domain, ) operation = Gecode::Util::SET_OPERATION_TYPES[@operator] if constrain_domain if operation == Gecode::Raw::SOT_INTER set_operand.must_be.subset_of @enum.first.upper_bound else set_operand.must_be.subset_of @enum.upper_bound_range end end Gecode::Raw::rel(@model.active_space, operation, @enum.to_set_enum.bind_array, set_operand.to_set_var.bind) end |