Class: NewStoreApi::RoutingDecisionTrace
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::RoutingDecisionTrace
- Defined in:
- lib/new_store_api/models/routing_decision_trace.rb
Overview
Optional decision trace explaining how routing chose placements.
Instance Attribute Summary collapse
-
#after_filters_sorted_row ⇒ Object
Location weights after filters, sorted for display.
-
#fetchers_snapshot ⇒ Object
Snapshot of fetcher inputs used for the simulation run.
-
#filter_steps ⇒ Array[Object]
Filter steps applied during routing.
-
#initial_location_row ⇒ Object
Initial location weights before filters.
-
#picked ⇒ RoutingDecisionTracePicked
Selected routing logic candidate in the decision trace.
-
#reducer_steps ⇒ Array[Object]
Reducer steps applied to candidate routing results.
-
#strategy ⇒ Object
Strategy execution details for the simulation.
-
#version ⇒ Integer
Decision trace schema version.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(after_filters_sorted_row = nil, fetchers_snapshot = nil, filter_steps = nil, initial_location_row = nil, picked = nil, reducer_steps = nil, strategy = nil, version = nil) ⇒ RoutingDecisionTrace
constructor
A new instance of RoutingDecisionTrace.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(after_filters_sorted_row = nil, fetchers_snapshot = nil, filter_steps = nil, initial_location_row = nil, picked = nil, reducer_steps = nil, strategy = nil, version = nil) ⇒ RoutingDecisionTrace
Returns a new instance of RoutingDecisionTrace.
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 68 def initialize(after_filters_sorted_row = nil, fetchers_snapshot = nil, filter_steps = nil, initial_location_row = nil, picked = nil, reducer_steps = nil, strategy = nil, version = nil) @after_filters_sorted_row = after_filters_sorted_row @fetchers_snapshot = fetchers_snapshot @filter_steps = filter_steps @initial_location_row = initial_location_row @picked = picked @reducer_steps = reducer_steps @strategy = strategy @version = version end |
Instance Attribute Details
#after_filters_sorted_row ⇒ Object
Location weights after filters, sorted for display.
14 15 16 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 14 def after_filters_sorted_row @after_filters_sorted_row end |
#fetchers_snapshot ⇒ Object
Snapshot of fetcher inputs used for the simulation run.
18 19 20 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 18 def fetchers_snapshot @fetchers_snapshot end |
#filter_steps ⇒ Array[Object]
Filter steps applied during routing.
22 23 24 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 22 def filter_steps @filter_steps end |
#initial_location_row ⇒ Object
Initial location weights before filters.
26 27 28 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 26 def initial_location_row @initial_location_row end |
#picked ⇒ RoutingDecisionTracePicked
Selected routing logic candidate in the decision trace.
30 31 32 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 30 def picked @picked end |
#reducer_steps ⇒ Array[Object]
Reducer steps applied to candidate routing results.
34 35 36 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 34 def reducer_steps @reducer_steps end |
#strategy ⇒ Object
Strategy execution details for the simulation.
38 39 40 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 38 def strategy @strategy end |
#version ⇒ Integer
Decision trace schema version.
42 43 44 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 42 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. after_filters_sorted_row = hash.key?('after_filters_sorted_row') ? hash['after_filters_sorted_row'] : nil fetchers_snapshot = hash.key?('fetchers_snapshot') ? hash['fetchers_snapshot'] : nil filter_steps = hash.key?('filter_steps') ? hash['filter_steps'] : nil initial_location_row = hash.key?('initial_location_row') ? hash['initial_location_row'] : nil picked = RoutingDecisionTracePicked.from_hash(hash['picked']) if hash['picked'] reducer_steps = hash.key?('reducer_steps') ? hash['reducer_steps'] : nil strategy = hash.key?('strategy') ? hash['strategy'] : nil version = hash.key?('version') ? hash['version'] : nil # Create object from extracted values. RoutingDecisionTrace.new(after_filters_sorted_row, fetchers_snapshot, filter_steps, initial_location_row, picked, reducer_steps, strategy, version) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['after_filters_sorted_row'] = 'after_filters_sorted_row' @_hash['fetchers_snapshot'] = 'fetchers_snapshot' @_hash['filter_steps'] = 'filter_steps' @_hash['initial_location_row'] = 'initial_location_row' @_hash['picked'] = 'picked' @_hash['reducer_steps'] = 'reducer_steps' @_hash['strategy'] = 'strategy' @_hash['version'] = 'version' @_hash end |
.nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 64 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 59 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
119 120 121 122 123 124 125 126 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 119 def inspect class_name = self.class.name.split('::').last "<#{class_name} after_filters_sorted_row: #{@after_filters_sorted_row.inspect},"\ " fetchers_snapshot: #{@fetchers_snapshot.inspect}, filter_steps: #{@filter_steps.inspect},"\ " initial_location_row: #{@initial_location_row.inspect}, picked: #{@picked.inspect},"\ " reducer_steps: #{@reducer_steps.inspect}, strategy: #{@strategy.inspect}, version:"\ " #{@version.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
110 111 112 113 114 115 116 |
# File 'lib/new_store_api/models/routing_decision_trace.rb', line 110 def to_s class_name = self.class.name.split('::').last "<#{class_name} after_filters_sorted_row: #{@after_filters_sorted_row}, fetchers_snapshot:"\ " #{@fetchers_snapshot}, filter_steps: #{@filter_steps}, initial_location_row:"\ " #{@initial_location_row}, picked: #{@picked}, reducer_steps: #{@reducer_steps}, strategy:"\ " #{@strategy}, version: #{@version}>" end |