Movatterモバイル変換


[0]ホーム

URL:


はてラボはてな匿名ダイアリー
ようこそ ゲスト さんログインユーザー登録
< anond:20250412164024 |anond:20250413061045 >

2025-04-13

anond:20250413061825

def demo_unprocessed_emotion():

"""未処理感情システムデモ改善点(記憶編集言語学習、反応速度など)を活用"""

cognitive_queue = CognitiveQueue(attention_threshold=0.4)

print("=== 未処理感情システムデモ改善版) ===\n")

# 1.視覚的な違和感

print("1.視覚的な違和感の生成")

visual_signals = [

SensorySignal("visual", 0.7, -0.3),

SensorySignal("somatic", 0.4, -0.2)

]

visual_discomfort = cognitive_queue.register_new_emotion(visual_signals, 0.65)

print(f"生成された感情: {visual_discomfort}")

print(f"支配モダリティ: {visual_discomfort.get_dominant_modality()}")

print(f"平均感情価: {visual_discomfort.get_average_valence():.2f}")

print(f"信号反応速度: {[s.latency for s in visual_signals]}")

visual_discomfort.add_pattern_match("visual_discrepancy", 0.75)

try:

visual_discomfort.add_memory_path("/memory/recent/room_layout")

except ValueErroras e:

print(f"記憶パスエラー: {e}")

# 2.記憶の再編集

print("\n2.感情へのアクセス(再編集)")

accessed_emotion = cognitive_queue.access_emotion(visual_discomfort)

print(f"新しい感情インスタンス: {accessed_emotion}")

print(f"構造レベル(再編集後): {accessed_emotion.structure_level:.2f}")

# 3. 内受容感覚

print("\n3. 内受容感覚の生成")

intero_signals = [

SensorySignal("interoceptive", 0.6, -0.7),

SensorySignal("somatic", 0.5, -0.4)

]

intero_discomfort = cognitive_queue.register_new_emotion(intero_signals, 0.55)

print(f"生成された感情: {intero_discomfort}")

intero_discomfort.add_language_candidate("違和感", 0.4)

cognitive_queue.partially_process(intero_discomfort, "気分が悪い", 0.6, context="negative_mood")

print(f"学習済み言語: {cognitive_queue.learned_terms}")

# 4.聴覚記憶

print("\n4.聴覚記憶の生成")

audio_signals = [

SensorySignal("auditory", 0.8, 0.6),

SensorySignal("emotional", 0.7, 0.5)

]

audio_memory = cognitive_queue.register_new_emotion(audio_signals, 0.7)

print(f"生成された感情: {audio_memory}")

audio_memory.add_language_candidate("聞き覚えのあるメロディ", 0.75)

audio_memory.add_pattern_match("musical_fragment", 0.85)

audio_memory.add_memory_path("/memory/music/recent")

# 5.キュー更新

print("\n5.認知キュー更新")

cognitive_queue.update_queue()

status = cognitive_queue.get_status_summary()

print(f"未処理感情の総数: {status['total_unprocessed']}")

print(f"処理キューサイズ: {status['processing_queue_size']}")

print(f"モダリティ分布: {status['modality_distribution']}")

print(f"感情分布: {status['valence_distribution']}")

print(f"学習済み言語数: {status['learned_terms_count']}")

# 6. 処理対象の取得

print("\n6. 処理対象の取得")

next_emotion = cognitive_queue.get_next_for_processing()

print(f"処理対象: {next_emotion}")

# 7.感情部分的処理

print("\n7.感情部分的処理")

if next_emotion:

cognitive_queue.partially_process(next_emotion, "視覚的な違和感を感じている", 0.85, context="visual_anomaly")

print(f"処理後の状態: {next_emotion}")

print(f"構造レベル: {next_emotion.structure_level:.2f}")

print(f"最良の言語マッチ: {next_emotion.get_best_language_match()}")

# 8. 高速モダリティ検索

print("\n8.モダリティによる感情検索インデックス使用)")

matches = cognitive_queue.lookup_by_modality("auditory")

print(f"検索結果数: {len(matches)}")

formatch inmatches:

print(f"- {match}")

#9.時間経過シミュレーション

print("\n9.時間経過のシミュレーション")

foremotion in cognitive_queue.unprocessed_emotions:

emotion.apply_decay(3.0)

cognitive_queue.update_queue()

status = cognitive_queue.get_status_summary()

print(f"時間経過後の未処理感情の総数: {status['total_unprocessed']}")

print(f"時間経過後の平均顕在性: {status['average_salience']:.2f}")

if __name__ == "__main__":

demo_unprocessed_emotion()

Permalink |記事への反応(0) | 06:27

このエントリーをはてなブックマークに追加ツイートシェア

記事への反応 -

記事への反応(ブックマークコメント)

全てのコメントを見る

人気エントリ

注目エントリ

ログインユーザー登録
ようこそ ゲスト さん
Copyright (C) 2001-2025 hatena. All Rights Reserved.

[8]ページ先頭

©2009-2025 Movatter.jp