Class: BatchExperiment::PyaExtractor

Inherits:
Object
  • Object
show all
Extended by:
Extractor
Defined in:
lib/batch_experiment/sample_extractors.rb

Overview

Extractor for the output of the pyasukp program available at github.com/henriquebecker91/masters. Not of interest for the majority of the users of this gem. Kept as example, and for this gem author personal use.

Class Method Summary collapse

Methods included from Extractor

extract, extract_from_lines, get_field, get_hfield, names

Class Method Details

.extract_from_lines(lines) ⇒ Object



80
81
82
83
84
85
86
# File 'lib/batch_experiment/sample_extractors.rb', line 80

def self.extract_from_lines(lines)
  values = ['Total Time ', 'ext_time', 'ext_mem'].map do | label |
    Extractor.get_field(lines, label)
  end
  opt_key = '#The optimal value for the given capacity'
  values << Extractor.get_hfield(lines, opt_key)
end

.namesObject



76
77
78
# File 'lib/batch_experiment/sample_extractors.rb', line 76

def self.names
  ['internal time', 'external time', 'external memory', 'opt']
end