Class: Legion::Extensions::Agentic::Executive::DecisionFatigue::Helpers::DecisionRecord
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Executive::DecisionFatigue::Helpers::DecisionRecord
- Defined in:
- lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb
Instance Attribute Summary collapse
-
#complexity ⇒ Object
readonly
Returns the value of attribute complexity.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#decision_type ⇒ Object
readonly
Returns the value of attribute decision_type.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#quality_at_time ⇒ Object
readonly
Returns the value of attribute quality_at_time.
-
#willpower_cost ⇒ Object
readonly
Returns the value of attribute willpower_cost.
Instance Method Summary collapse
- #complexity_label ⇒ Object
-
#initialize(id:, label:, decision_type:, complexity:, quality_at_time:, willpower_cost:) ⇒ DecisionRecord
constructor
A new instance of DecisionRecord.
- #quality_label ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(id:, label:, decision_type:, complexity:, quality_at_time:, willpower_cost:) ⇒ DecisionRecord
Returns a new instance of DecisionRecord.
13 14 15 16 17 18 19 20 21 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 13 def initialize(id:, label:, decision_type:, complexity:, quality_at_time:, willpower_cost:) @id = id @label = label @decision_type = decision_type @complexity = complexity.clamp(0.0, 1.0) @quality_at_time = quality_at_time.clamp(Constants::QUALITY_FLOOR, 1.0) @willpower_cost = willpower_cost @created_at = Time.now.utc end |
Instance Attribute Details
#complexity ⇒ Object (readonly)
Returns the value of attribute complexity.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 10 def complexity @complexity end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 10 def created_at @created_at end |
#decision_type ⇒ Object (readonly)
Returns the value of attribute decision_type.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 10 def decision_type @decision_type end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 10 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 10 def label @label end |
#quality_at_time ⇒ Object (readonly)
Returns the value of attribute quality_at_time.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 10 def quality_at_time @quality_at_time end |
#willpower_cost ⇒ Object (readonly)
Returns the value of attribute willpower_cost.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 10 def willpower_cost @willpower_cost end |
Instance Method Details
#complexity_label ⇒ Object
23 24 25 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 23 def complexity_label Constants.complexity_label_for(@complexity) end |
#quality_label ⇒ Object
27 28 29 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 27 def quality_label Constants.quality_label_for(@quality_at_time) end |
#to_h ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/legion/extensions/agentic/executive/decision_fatigue/helpers/decision_record.rb', line 31 def to_h { id: @id, label: @label, decision_type: @decision_type, complexity: @complexity, complexity_label: complexity_label, quality_at_time: @quality_at_time, quality_label: quality_label, willpower_cost: @willpower_cost, created_at: @created_at } end |