Class: Gecode::IntEnum::Element::ElementIntOperand
- Inherits:
-
Gecode::Int::ShortCircuitEqualityOperand
- Object
- Gecode::Int::ShortCircuitEqualityOperand
- Gecode::IntEnum::Element::ElementIntOperand
- Defined in:
- lib/gecoder/interface/constraints/int_enum/element.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Gecode::Int::ShortCircuitEqualityOperand
Instance Method Summary collapse
- #constrain_equal(int_operand, constrain, propagation_options) ⇒ Object
-
#initialize(model, enum_op, position_int_var_op) ⇒ ElementIntOperand
constructor
A new instance of ElementIntOperand.
Methods inherited from Gecode::Int::ShortCircuitEqualityOperand
#construct_receiver, #to_int_var
Methods included from Gecode::Int::IntOperand
#*, #+, #-, #abs, #method_missing, #pre_arith_mult, #square_root, #squared
Methods included from Operand
Constructor Details
#initialize(model, enum_op, position_int_var_op) ⇒ ElementIntOperand
Returns a new instance of ElementIntOperand.
46 47 48 49 50 |
# File 'lib/gecoder/interface/constraints/int_enum/element.rb', line 46 def initialize(model, enum_op, position_int_var_op) super model @enum = enum_op @position = position_int_var_op end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Gecode::Int::IntOperand
Instance Method Details
#constrain_equal(int_operand, constrain, propagation_options) ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/gecoder/interface/constraints/int_enum/element.rb', line 52 def constrain_equal(int_operand, constrain, ) enum = @enum.to_int_enum if constrain int_operand.must_be.in enum.domain_range end Gecode::Raw::element(model.active_space, enum.bind_array, @position.to_int_var.bind, int_operand.to_int_var.bind, *) end |