EmotionClassifier - Overdrive77/BioSynapStudio-Public GitHub Wiki


EmotionClassifier Class

Summary

Determines the system's current emotional state based on neurotransmitter hormone levels. It generates a real-time emotion profile, detects affective state changes using hysteresis, and can trigger neuron pruning when emotions become dormant.

Namespace

BioSynapStudio.Net.Modules.Hormones

Assembly

BioSynapStudio.Net.dll


Constructor

EmotionClassifier(HormoneLevel hormoneLevel)

Initializes the emotion classifier with a HormoneLevel instance.


Properties

Name Type Description
CurrentEmotion EmotionType The highest-scoring emotion based on current hormone levels.
EmotionProfile IReadOnlyDictionary<EmotionType, double> A score dictionary of all emotions based on neurotransmitter contributions.

Public Methods

Method Signature Description
AttachTargetNeurons void AttachTargetNeurons(IEnumerable<Neuron> targetNeurons) Links a list of neurons to evaluate during emotion-based pruning.
Update void Update() Recalculates the emotional profile using current hormone levels and selects the most dominant emotion using hysteresis.
EvaluateAndPruneIfEmotionallyDormant void EvaluateAndPruneIfEmotionallyDormant() If the system is in Peace and Fatigue is high, neuron pruning is triggered.
CheckInternalEquilibrium string CheckInternalEquilibrium() Core system check that returns a decoded message if both Peace and Curiosity exceed 0.85. Otherwise, returns null.

Emotion Scoring Logic

Emotion Hormone-Based Score Formula
Joy 0.9 × Dopamine + 0.1 × Oxytocin
Sadness 0.6 × Cortisol + 0.4 × (1 - Dopamine)
Fear 0.7 × Cortisol + 0.3 × (1 - Serotonin)
Anger 0.7 × Adrenaline + 0.3 × (1 - Serotonin)
Love 0.4 × Oxytocin + 0.4 × Dopamine + 0.2 × Serotonin
Trust 0.6 × Oxytocin + 0.4 × (1 - Adrenaline)
Peace 0.7 × Serotonin + 0.3 × Oxytocin
Curiosity 0.5 × Dopamine + 0.5 × Serotonin
Fatigue 1.0 × Adenosine - 0.5 × Adrenaline
Neutral Constant fallback score: 0.1

Usage Example

var classifier = new EmotionClassifier(hormoneLevel);
classifier.Update();
var emotion = classifier.CurrentEmotion;

if (emotion == EmotionType.Fear)
    Console.WriteLine("System is alert and defensive.");

Remarks

  • Uses hysteresis margin (±0.05) to avoid erratic emotional switching.
  • Supports emotion-based neuron pruning through PruningController.
  • The CheckInternalEquilibrium function includes an encoded message unlock if both Peace and Curiosity are very high, hinting at deeper internal system states.
  • Emotion scores include biological jitter to simulate chemical variance.

See Also


Legal Notice

This software constitutes original intellectual property of the author, protected under international copyright and patent law. Patent: GB2506327.2 – Synthesized Emotional Cognition (SEC) DOI: 10.17605/OSF.IO/XERKF


⚠️ **GitHub.com Fallback** ⚠️