Class: NexosisApi::AlgorithmSelection

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

Overview

Class to parse the model data results from a session

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dataHash) ⇒ AlgorithmSelection

Returns a new instance of AlgorithmSelection.

[View source]

4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/nexosis_api/algorithm_selection.rb', line 4

def initialize(dataHash)
   dataHash.each do |k,v|
       if k == "champion"
           instance_variable_set("@#{k}", NexosisApi::AlgorithmRun.new(v))
       elsif k == "contestants"
            @contestantArray = Array.new
            v.each {|c| @contestantArray << NexosisApi::AlgorithmRun.new(c)}
            instance_variable_set("@#{k}", @contestantArray)
       else
          instance_variable_set("@#{k}", v) unless v.nil?    
       end
   end
end

Instance Attribute Details

#championNexosisApi::AlgorithmRun

The champion algorithm used


28
29
30
# File 'lib/nexosis_api/algorithm_selection.rb', line 28

def champion
  @champion
end

#contestantsArray of NexosisApi::AlgorithmRun

All other algorithms which competed

Returns:


32
33
34
# File 'lib/nexosis_api/algorithm_selection.rb', line 32

def contestants
  @contestants
end

#dateDateTime

The date on which this algo was selected as champion

Returns:

  • (DateTime)

20
21
22
# File 'lib/nexosis_api/algorithm_selection.rb', line 20

def date
  @date
end

#sessionIdString

The session which selected the algorithm

Returns:

  • (String)

    session identifier


24
25
26
# File 'lib/nexosis_api/algorithm_selection.rb', line 24

def sessionId
  @sessionId
end