Class: Legion::Extensions::Agentic::Social::Mirror::Helpers::Simulation
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Social::Mirror::Helpers::Simulation
- Defined in:
- lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb
Instance Attribute Summary collapse
-
#accuracy_score ⇒ Object
Returns the value of attribute accuracy_score.
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#emotional_resonance ⇒ Object
readonly
Returns the value of attribute emotional_resonance.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#simulated_at ⇒ Object
readonly
Returns the value of attribute simulated_at.
-
#simulated_outcome ⇒ Object
readonly
Returns the value of attribute simulated_outcome.
Instance Method Summary collapse
-
#initialize(event_id:, simulated_outcome:, confidence: Constants::SIMULATION_CONFIDENCE_DEFAULT, emotional_resonance: Constants::DEFAULT_RESONANCE) ⇒ Simulation
constructor
A new instance of Simulation.
- #to_h ⇒ Object
Constructor Details
#initialize(event_id:, simulated_outcome:, confidence: Constants::SIMULATION_CONFIDENCE_DEFAULT, emotional_resonance: Constants::DEFAULT_RESONANCE) ⇒ Simulation
Returns a new instance of Simulation.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb', line 15 def initialize(event_id:, simulated_outcome:, confidence: Constants::SIMULATION_CONFIDENCE_DEFAULT, emotional_resonance: Constants::DEFAULT_RESONANCE) @id = SecureRandom.uuid @event_id = event_id @simulated_outcome = simulated_outcome @confidence = confidence.to_f.clamp(0.0, 1.0) @emotional_resonance = emotional_resonance.to_f.clamp(0.0, 1.0) @simulated_at = Time.now.utc @accuracy_score = nil end |
Instance Attribute Details
#accuracy_score ⇒ Object
Returns the value of attribute accuracy_score.
13 14 15 |
# File 'lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb', line 13 def accuracy_score @accuracy_score end |
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb', line 12 def confidence @confidence end |
#emotional_resonance ⇒ Object (readonly)
Returns the value of attribute emotional_resonance.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb', line 12 def emotional_resonance @emotional_resonance end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb', line 12 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb', line 12 def id @id end |
#simulated_at ⇒ Object (readonly)
Returns the value of attribute simulated_at.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb', line 12 def simulated_at @simulated_at end |
#simulated_outcome ⇒ Object (readonly)
Returns the value of attribute simulated_outcome.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb', line 12 def simulated_outcome @simulated_outcome end |
Instance Method Details
#to_h ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/legion/extensions/agentic/social/mirror/helpers/simulation.rb', line 26 def to_h { id: @id, event_id: @event_id, simulated_outcome: @simulated_outcome, confidence: @confidence, emotional_resonance: @emotional_resonance, simulated_at: @simulated_at, accuracy_score: @accuracy_score } end |