Class: Legion::Extensions::Agentic::Attention::Subliminal::Helpers::InfluenceEvent
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Attention::Subliminal::Helpers::InfluenceEvent
- Includes:
- Constants
- Defined in:
- lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb
Constant Summary
Constants included from Constants
Constants::ACCUMULATION_RATE, Constants::ACTIVATION_BOOST, Constants::ACTIVATION_DECAY, Constants::ACTIVATION_LABELS, Constants::CONSCIOUS_THRESHOLD, Constants::DEFAULT_ACTIVATION, Constants::EXTINCTION_THRESHOLD, Constants::INFLUENCE_LABELS, Constants::INFLUENCE_STRENGTH, Constants::INFLUENCE_TARGETS, Constants::MAX_INFLUENCES, Constants::MAX_INFLUENCE_PER_DOMAIN, Constants::MAX_TOTAL_INFLUENCE, Constants::MAX_TRACES, Constants::SATURATION_LABELS, Constants::SUBLIMINAL_CEILING, Constants::SUBLIMINAL_FLOOR, Constants::TRACE_TYPES
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#magnitude ⇒ Object
readonly
Returns the value of attribute magnitude.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#trace_id ⇒ Object
readonly
Returns the value of attribute trace_id.
Instance Method Summary collapse
-
#initialize(trace_id:, target:, magnitude:, domain: :general) ⇒ InfluenceEvent
constructor
A new instance of InfluenceEvent.
- #significant? ⇒ Boolean
- #subtle? ⇒ Boolean
- #to_h ⇒ Object
Methods included from Constants
Constructor Details
#initialize(trace_id:, target:, magnitude:, domain: :general) ⇒ InfluenceEvent
Returns a new instance of InfluenceEvent.
16 17 18 19 20 21 22 23 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 16 def initialize(trace_id:, target:, magnitude:, domain: :general) @id = SecureRandom.uuid @trace_id = trace_id @target = target.to_sym @magnitude = magnitude.to_f.clamp(0.0, MAX_INFLUENCE_PER_DOMAIN).round(10) @domain = domain.to_sym @created_at = Time.now end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 14 def created_at @created_at end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 14 def domain @domain end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 14 def id @id end |
#magnitude ⇒ Object (readonly)
Returns the value of attribute magnitude.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 14 def magnitude @magnitude end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 14 def target @target end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 14 def trace_id @trace_id end |
Instance Method Details
#significant? ⇒ Boolean
25 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 25 def significant? = @magnitude >= 0.05 |
#subtle? ⇒ Boolean
26 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 26 def subtle? = @magnitude < 0.05 && @magnitude > 0.0 |
#to_h ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/legion/extensions/agentic/attention/subliminal/helpers/influence_event.rb', line 28 def to_h { id: @id, trace_id: @trace_id, target: @target, magnitude: @magnitude, domain: @domain, created_at: @created_at.iso8601 } end |