Class: MistApi::RrmBandMetric

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/rrm_band_metric.rb

Overview

RrmBandMetric Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(cochannel_neighbors = nil, density = nil, neighbors = nil, noise = nil, avg_aps_per_channel = SKIP, channel_distribution_uniformity = SKIP, interferences = SKIP, naps_by_channel = SKIP, naps_by_power = SKIP) ⇒ RrmBandMetric

Returns a new instance of RrmBandMetric.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/mist_api/models/rrm_band_metric.rb', line 82

def initialize(cochannel_neighbors = nil, density = nil, neighbors = nil,
               noise = nil, avg_aps_per_channel = SKIP,
               channel_distribution_uniformity = SKIP, interferences = SKIP,
               naps_by_channel = SKIP, naps_by_power = SKIP)
  @avg_aps_per_channel = avg_aps_per_channel unless avg_aps_per_channel == SKIP
  unless channel_distribution_uniformity == SKIP
    @channel_distribution_uniformity =
      channel_distribution_uniformity
  end
  @cochannel_neighbors = cochannel_neighbors
  @density = density
  @interferences = interferences unless interferences == SKIP
  @naps_by_channel = naps_by_channel unless naps_by_channel == SKIP
  @naps_by_power = naps_by_power unless naps_by_power == SKIP
  @neighbors = neighbors
  @noise = noise
end

Instance Attribute Details

#avg_aps_per_channelFloat

Average number of APs per channel

Returns:

  • (Float)


14
15
16
# File 'lib/mist_api/models/rrm_band_metric.rb', line 14

def avg_aps_per_channel
  @avg_aps_per_channel
end

#channel_distribution_uniformityFloat

Distribution of channel across the Access Points

Returns:

  • (Float)


18
19
20
# File 'lib/mist_api/models/rrm_band_metric.rb', line 18

def channel_distribution_uniformity
  @channel_distribution_uniformity
end

#cochannel_neighborsFloat

Average number of co-channel neighbors

Returns:

  • (Float)


22
23
24
# File 'lib/mist_api/models/rrm_band_metric.rb', line 22

def cochannel_neighbors
  @cochannel_neighbors
end

#densityFloat

defined by how APs can hear from one and another, 0 - 1 (everyone can hear everyone)

Returns:

  • (Float)


27
28
29
# File 'lib/mist_api/models/rrm_band_metric.rb', line 27

def density
  @density
end

#interferencesHash[String, RrmBandMetricInterference]

Property key is the channel number

Returns:



31
32
33
# File 'lib/mist_api/models/rrm_band_metric.rb', line 31

def interferences
  @interferences
end

#naps_by_channelHash[String, Float]

Property key is the channel number, value is number of APs on that channel

Returns:

  • (Hash[String, Float])


35
36
37
# File 'lib/mist_api/models/rrm_band_metric.rb', line 35

def naps_by_channel
  @naps_by_channel
end

#naps_by_powerHash[String, Float]

Property key is the power level, value is number of APs on that power level

Returns:

  • (Hash[String, Float])


40
41
42
# File 'lib/mist_api/models/rrm_band_metric.rb', line 40

def naps_by_power
  @naps_by_power
end

#neighborsFloat

Average number of neighbors

Returns:

  • (Float)


44
45
46
# File 'lib/mist_api/models/rrm_band_metric.rb', line 44

def neighbors
  @neighbors
end

#noiseFloat

Average noise in dBm

Returns:

  • (Float)


48
49
50
# File 'lib/mist_api/models/rrm_band_metric.rb', line 48

def noise
  @noise
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/mist_api/models/rrm_band_metric.rb', line 101

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cochannel_neighbors =
    hash.key?('cochannel_neighbors') ? hash['cochannel_neighbors'] : nil
  density = hash.key?('density') ? hash['density'] : nil
  neighbors = hash.key?('neighbors') ? hash['neighbors'] : nil
  noise = hash.key?('noise') ? hash['noise'] : nil
  avg_aps_per_channel =
    hash.key?('avg_aps_per_channel') ? hash['avg_aps_per_channel'] : SKIP
  channel_distribution_uniformity =
    hash.key?('channel_distribution_uniformity') ? hash['channel_distribution_uniformity'] : SKIP
  interferences = RrmBandMetricInterference.from_hash(hash['interferences']) if
    hash['interferences']

  interferences = SKIP unless hash.key?('interferences')
  naps_by_channel =
    hash.key?('naps_by_channel') ? hash['naps_by_channel'] : SKIP
  naps_by_power = hash.key?('naps_by_power') ? hash['naps_by_power'] : SKIP

  # Create object from extracted values.
  RrmBandMetric.new(cochannel_neighbors,
                    density,
                    neighbors,
                    noise,
                    avg_aps_per_channel,
                    channel_distribution_uniformity,
                    interferences,
                    naps_by_channel,
                    naps_by_power)
end

.namesObject

A mapping from model property names to API property names.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/mist_api/models/rrm_band_metric.rb', line 51

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['avg_aps_per_channel'] = 'avg_aps_per_channel'
  @_hash['channel_distribution_uniformity'] =
    'channel_distribution_uniformity'
  @_hash['cochannel_neighbors'] = 'cochannel_neighbors'
  @_hash['density'] = 'density'
  @_hash['interferences'] = 'interferences'
  @_hash['naps_by_channel'] = 'naps_by_channel'
  @_hash['naps_by_power'] = 'naps_by_power'
  @_hash['neighbors'] = 'neighbors'
  @_hash['noise'] = 'noise'
  @_hash
end

.nullablesObject

An array for nullable fields



78
79
80
# File 'lib/mist_api/models/rrm_band_metric.rb', line 78

def self.nullables
  []
end

.optionalsObject

An array for optional fields



67
68
69
70
71
72
73
74
75
# File 'lib/mist_api/models/rrm_band_metric.rb', line 67

def self.optionals
  %w[
    avg_aps_per_channel
    channel_distribution_uniformity
    interferences
    naps_by_channel
    naps_by_power
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



145
146
147
148
149
150
151
152
153
# File 'lib/mist_api/models/rrm_band_metric.rb', line 145

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} avg_aps_per_channel: #{@avg_aps_per_channel.inspect},"\
  " channel_distribution_uniformity: #{@channel_distribution_uniformity.inspect},"\
  " cochannel_neighbors: #{@cochannel_neighbors.inspect}, density: #{@density.inspect},"\
  " interferences: #{@interferences.inspect}, naps_by_channel: #{@naps_by_channel.inspect},"\
  " naps_by_power: #{@naps_by_power.inspect}, neighbors: #{@neighbors.inspect}, noise:"\
  " #{@noise.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



135
136
137
138
139
140
141
142
# File 'lib/mist_api/models/rrm_band_metric.rb', line 135

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} avg_aps_per_channel: #{@avg_aps_per_channel},"\
  " channel_distribution_uniformity: #{@channel_distribution_uniformity}, cochannel_neighbors:"\
  " #{@cochannel_neighbors}, density: #{@density}, interferences: #{@interferences},"\
  " naps_by_channel: #{@naps_by_channel}, naps_by_power: #{@naps_by_power}, neighbors:"\
  " #{@neighbors}, noise: #{@noise}>"
end