Module: Gecode::BoolEnumMethods

Includes:
Gecode::BoolEnum::BoolEnumOperand, VariableEnumMethods
Defined in:
lib/gecoder/interface/enum_wrapper.rb

Overview

A module containing the methods needed by enumerations containing boolean operands. Requires that it’s included in an enumerable.

Instance Attribute Summary

Attributes included from EnumMethods

#model

Instance Method Summary collapse

Methods included from VariableEnumMethods

#values

Methods included from EnumMethods

#active_space

Methods included from Gecode::BoolEnum::BoolEnumOperand

#conjunction, #disjunction, #method_missing

Methods included from Operand

#model, #must, #must_not

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Gecode::BoolEnum::BoolEnumOperand

Instance Method Details

#bind_arrayObject

Returns a bool variable array with all the bound variables.



115
116
117
118
119
120
121
122
123
124
# File 'lib/gecoder/interface/enum_wrapper.rb', line 115

def bind_array
  space = @model.active_space
  unless @bound_space == space
    elements = to_a
    @bound_arr = Gecode::Raw::BoolVarArray.new(active_space, elements.size)
    elements.each_with_index{ |var, index| @bound_arr[index] = var.bind }
    @bound_space = space
  end
  return @bound_arr
end

#to_bool_enumObject

Returns the receiver.



127
128
129
# File 'lib/gecoder/interface/enum_wrapper.rb', line 127

def to_bool_enum
  self
end