Class: Gecode::FreeVarBase

Inherits:
Object
  • Object
show all
Defined in:
lib/gecoder/interface/variables.rb

Overview

Describes a variable that is bound to a model, but not to a particular space.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, index) ⇒ FreeVarBase

Creates an int variable with the specified index.



8
9
10
11
12
# File 'lib/gecoder/interface/variables.rb', line 8

def initialize(model, index)
  @model = model
  @index = index
  model.track_variable(self)
end

Instance Attribute Details

#modelObject

:nodoc:



5
6
7
# File 'lib/gecoder/interface/variables.rb', line 5

def model
  @model
end

Instance Method Details

#inspectObject



14
15
16
17
18
19
20
# File 'lib/gecoder/interface/variables.rb', line 14

def inspect
  if assigned?
    "#<#{self.class} #{domain_string}>"
  else
    "#<#{self.class} #{domain_string}>"
  end
end