Class: Gecode::SetElements::SetElementsOperand

Inherits:
Object
  • Object
show all
Includes:
Operand
Defined in:
lib/gecoder/interface/constraints/set_elements_constraints.rb

Overview

A SetElementsOperand is an uncommon operand that results from calling SetOperand#elements. It facilitates placing the constraints defined in SetElementsConstraintReceiver

Examples

Producing a SetElementsOperand from set_operand:

set_operand.elements

Instance Method Summary collapse

Methods included from Operand

#must, #must_not

Constructor Details

#initialize(set) ⇒ SetElementsOperand

Constructs a new set elements operand set.



18
19
20
21
22
23
24
# File 'lib/gecoder/interface/constraints/set_elements_constraints.rb', line 18

def initialize(set) #:nodoc:
  unless set.respond_to? :to_set_var
    raise TypeError, "Expected set operand, got #{set.class}."
  end

  @set = set
end

Instance Method Details

#modelObject

:nodoc:



31
32
33
# File 'lib/gecoder/interface/constraints/set_elements_constraints.rb', line 31

def model #:nodoc:
  @set.model
end

#to_set_elementsObject

Returns the set operand that makes up the set elements operand.



27
28
29
# File 'lib/gecoder/interface/constraints/set_elements_constraints.rb', line 27

def to_set_elements #:nodoc:
  return @set
end