viva_emotion/fusion

Fusion - Combining multiple emotional sources

Theory (Borotschnig 2025 inspired)

Emotions arise from multiple sources simultaneously:

  1. Need-based: Interoception (hardware stress, hunger)
  2. Past-based: Memory retrieval (similar situations)
  3. Personality: Baseline disposition (trait affect)

The fusion process adaptively weights these sources based on context:

FusedPAD = w_need × NeedPAD + w_past × PastPAD + w_pers × PersonalityPAD

where: w_need + w_past + w_pers = 1.0

Adaptive Weighting

References

Types

Which source is driving the fused emotion

pub type DominantSource {
  DominantNeed
  DominantPast
  DominantPersonality
}

Constructors

  • DominantNeed
  • DominantPast
  • DominantPersonality

Configuration for weight calculation

pub type FusionConfig {
  FusionConfig(
    base_need: Float,
    base_past: Float,
    base_personality: Float,
    arousal_boost: Float,
    confidence_boost: Float,
    novelty_boost: Float,
  )
}

Constructors

  • FusionConfig(
      base_need: Float,
      base_past: Float,
      base_personality: Float,
      arousal_boost: Float,
      confidence_boost: Float,
      novelty_boost: Float,
    )

    Arguments

    base_need

    Base weight for need-based emotions

    base_past

    Base weight for past-based emotions

    base_personality

    Base weight for personality

    arousal_boost

    How much arousal boosts need weight

    confidence_boost

    How much confidence boosts past weight

    novelty_boost

    How much novelty boosts personality weight

Context for adaptive weight calculation

pub type FusionContext {
  FusionContext(
    arousal: Float,
    confidence: Float,
    novelty: Float,
  )
}

Constructors

  • FusionContext(arousal: Float, confidence: Float, novelty: Float)

    Arguments

    arousal

    Current arousal level (from state) - higher = trust needs more

    confidence

    Confidence in past experience (from memory retrieval) [0, 1]

    novelty

    Novelty of current situation [0, 1] - higher = trust personality more

Calculated fusion weights (always sum to 1.0)

pub type FusionWeights {
  FusionWeights(need: Float, past: Float, personality: Float)
}

Constructors

  • FusionWeights(need: Float, past: Float, personality: Float)

Values

pub fn calculate_weights(
  context: FusionContext,
  config: FusionConfig,
) -> FusionWeights

Calculate adaptive weights based on context

Higher arousal → need weight increases (survival mode) Higher confidence → past weight increases (trust experience) Higher novelty → personality weight increases (fall back to baseline)

pub fn coherence(
  need: pad.Pad,
  past: pad.Pad,
  personality: pad.Pad,
) -> Float

Calculate “emotional coherence” - how aligned are the sources? High coherence = sources agree, low = conflict

pub fn default_config() -> FusionConfig

Default fusion configuration

pub fn dominant_source(weights: FusionWeights) -> DominantSource

When sources conflict, which one dominates?

pub fn fuse(
  need: pad.Pad,
  past: pad.Pad,
  personality: pad.Pad,
  context: FusionContext,
) -> pad.Pad

Fuse multiple PAD sources into single emotional state

Uses adaptive weights based on context

pub fn fuse_explicit(
  need: pad.Pad,
  past: pad.Pad,
  personality: pad.Pad,
  weights: FusionWeights,
) -> pad.Pad

Fuse with explicit weights (bypasses adaptive calculation)

pub fn fuse_simple(
  need: pad.Pad,
  personality: pad.Pad,
  arousal: Float,
) -> pad.Pad

Quick fusion with just need and personality (no memory) Useful when memory system is unavailable

pub fn fuse_with(
  need: pad.Pad,
  past: pad.Pad,
  personality: pad.Pad,
  context: FusionContext,
  config: FusionConfig,
) -> pad.Pad

Fuse with custom configuration

pub fn has_conflict(
  need: pad.Pad,
  past: pad.Pad,
  personality: pad.Pad,
) -> Bool

Check if there’s emotional conflict (low coherence)

pub fn neutral_context() -> FusionContext

Create a neutral context (equal weighting)

Search Document