Class: CompareCompressors::CostPlotter

Inherits:
Plotter
  • Object
show all
Defined in:
lib/compare_compressors/plotters/cost_plotter.rb

Overview

Plot compression results to gnuplot in 2D cost space (time cost and space cost).

Constant Summary collapse

DEFAULT_SHOW_COST_CONTOURS =
true

Constants inherited from Plotter

Plotter::DEFAULT_AUTOSCALE_FIX, Plotter::DEFAULT_LMARGIN, Plotter::DEFAULT_LOGSCALE_SIZE, Plotter::DEFAULT_OUTPUT, Plotter::DEFAULT_SHOW_LABELS, Plotter::DEFAULT_TERMINAL, Plotter::DEFAULT_TITLE, Plotter::DEFAULT_USE_CPU_TIME

Instance Attribute Summary collapse

Attributes inherited from Plotter

#autoscale_fix, #group_results, #io, #lmargin, #logscale_size, #output, #show_labels, #terminal, #title, #use_cpu_time

Instance Method Summary collapse

Methods inherited from Plotter

#plot

Constructor Details

#initialize(cost_model, **options) ⇒ CostPlotter

Returns a new instance of CostPlotter.



11
12
13
14
15
16
17
18
19
20
# File 'lib/compare_compressors/plotters/cost_plotter.rb', line 11

def initialize(cost_model, **options)
  @cost_model = cost_model
  @show_cost_contours = \
    if options.key?(:show_cost_contours)
      options.delete(:show_cost_contours)
    else
      DEFAULT_SHOW_COST_CONTOURS
    end
  super(**options)
end

Instance Attribute Details

#cost_modelObject (readonly)

Returns the value of attribute cost_model.



22
23
24
# File 'lib/compare_compressors/plotters/cost_plotter.rb', line 22

def cost_model
  @cost_model
end

#show_cost_contoursObject (readonly)

Returns the value of attribute show_cost_contours.



23
24
25
# File 'lib/compare_compressors/plotters/cost_plotter.rb', line 23

def show_cost_contours
  @show_cost_contours
end