Class: IOObserver

Inherits:
Object
  • Object
show all
Defined in:
lib/io_observer.rb

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ IOObserver

Returns a new instance of IOObserver.



2
3
4
# File 'lib/io_observer.rb', line 2

def initialize(io)
  @io = io
end

Instance Method Details

#hypothesized(experiment, hypothesis, seed) ⇒ Object



6
7
8
# File 'lib/io_observer.rb', line 6

def hypothesized(experiment, hypothesis, seed)
  @io.puts "#{Time.now.to_i}\thypothesis\t#{experiment}\t#{hypothesis}\t#{seed}"
end

#observed(name, value, seed) ⇒ Object



10
11
12
# File 'lib/io_observer.rb', line 10

def observed(name, value, seed)
  @io.puts "#{Time.now.to_i}\tobservation\t#{name}\t#{value}\t#{seed}"
end