Class: Legion::Extensions::Agentic::Attention::Synesthesia::Helpers::SynestheticEvent
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Attention::Synesthesia::Helpers::SynestheticEvent
- Includes:
- Constants
- Defined in:
- lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb
Constant Summary
Constants included from Constants
Constants::DEFAULT_STRENGTH, Constants::INTENSITY_LABELS, Constants::MAX_EVENTS, Constants::MAX_MAPPINGS, Constants::MODALITIES, Constants::RICHNESS_LABELS, Constants::STRENGTH_BOOST, Constants::STRENGTH_DECAY, Constants::STRENGTH_LABELS, Constants::TRIGGER_THRESHOLD
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#intensity ⇒ Object
readonly
Returns the value of attribute intensity.
-
#involuntary ⇒ Object
readonly
Returns the value of attribute involuntary.
-
#mapping_id ⇒ Object
readonly
Returns the value of attribute mapping_id.
-
#source_input ⇒ Object
readonly
Returns the value of attribute source_input.
-
#target_output ⇒ Object
readonly
Returns the value of attribute target_output.
-
#triggered_at ⇒ Object
readonly
Returns the value of attribute triggered_at.
Instance Method Summary collapse
-
#initialize(mapping_id:, source_input:, target_output:, intensity:, involuntary: true) ⇒ SynestheticEvent
constructor
A new instance of SynestheticEvent.
- #intensity_label ⇒ Object
- #to_h ⇒ Object
Methods included from Constants
Constructor Details
#initialize(mapping_id:, source_input:, target_output:, intensity:, involuntary: true) ⇒ SynestheticEvent
Returns a new instance of SynestheticEvent.
17 18 19 20 21 22 23 24 25 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 17 def initialize(mapping_id:, source_input:, target_output:, intensity:, involuntary: true) @id = SecureRandom.uuid @mapping_id = mapping_id @source_input = source_input @target_output = target_output @intensity = intensity.clamp(0.0, 1.0) @involuntary = involuntary @triggered_at = Time.now.utc end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 14 def id @id end |
#intensity ⇒ Object (readonly)
Returns the value of attribute intensity.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 14 def intensity @intensity end |
#involuntary ⇒ Object (readonly)
Returns the value of attribute involuntary.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 14 def involuntary @involuntary end |
#mapping_id ⇒ Object (readonly)
Returns the value of attribute mapping_id.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 14 def mapping_id @mapping_id end |
#source_input ⇒ Object (readonly)
Returns the value of attribute source_input.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 14 def source_input @source_input end |
#target_output ⇒ Object (readonly)
Returns the value of attribute target_output.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 14 def target_output @target_output end |
#triggered_at ⇒ Object (readonly)
Returns the value of attribute triggered_at.
14 15 16 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 14 def triggered_at @triggered_at end |
Instance Method Details
#intensity_label ⇒ Object
27 28 29 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 27 def intensity_label Constants.label_for(INTENSITY_LABELS, @intensity) end |
#to_h ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/legion/extensions/agentic/attention/synesthesia/helpers/synesthetic_event.rb', line 31 def to_h { id: @id, mapping_id: @mapping_id, source_input: @source_input, target_output: @target_output, intensity: @intensity, intensity_label: intensity_label, involuntary: @involuntary, triggered_at: @triggered_at } end |