Class: Gecode::Set::Operation::OperationSetOperand

Inherits:
ShortCircuitRelationsOperand show all
Defined in:
lib/gecoder/interface/constraints/set/operation.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from ShortCircuitRelationsOperand

#model

Instance Method Summary collapse

Methods inherited from ShortCircuitRelationsOperand

#construct_receiver, #to_set_var

Methods included from SetOperand

#disjoint_union, #elements, #intersection, #method_missing, #minus, #size, #union

Methods included from Operand

#model, #must, #must_not

Constructor Details

#initialize(model, op1, operator, op2) ⇒ OperationSetOperand

:nodoc:



79
80
81
82
83
84
# File 'lib/gecoder/interface/constraints/set/operation.rb', line 79

def initialize(model, op1, operator, op2)
  super model
  @op1 = op1
  @op2 = op2
  @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

#relation_constraint(relation, set_operand_or_constant_set, params) ⇒ Object



86
87
88
89
90
91
92
93
94
95
# File 'lib/gecoder/interface/constraints/set/operation.rb', line 86

def relation_constraint(relation, set_operand_or_constant_set, params)
  relation_type = 
    Gecode::Util::SET_RELATION_TYPES[relation]

  operation = Gecode::Util::SET_OPERATION_TYPES[@operator]
  params.update(:rhs => set_operand_or_constant_set, 
    :relation_type => relation_type, :op1 => @op1, :op2 => @op2,
    :operation => operation)
  OperationConstraint.new(model, params)
end