修复一个relation的bug
This commit is contained in:
@@ -237,7 +237,7 @@ class MoodManager:
|
|||||||
old_arousal = self.current_mood.arousal
|
old_arousal = self.current_mood.arousal
|
||||||
old_mood = self.current_mood.text
|
old_mood = self.current_mood.text
|
||||||
|
|
||||||
valence_change *= relationship_manager.gain_coefficient[relationship_manager.positive_feedback_value]
|
valence_change = relationship_manager.feedback_to_mood(valence_change)
|
||||||
|
|
||||||
# 应用情绪强度
|
# 应用情绪强度
|
||||||
valence_change *= intensity
|
valence_change *= intensity
|
||||||
|
|||||||
@@ -64,6 +64,14 @@ class RelationshipManager:
|
|||||||
logger.info(f"当前relationship增益系数:{mood_gain:.3f}")
|
logger.info(f"当前relationship增益系数:{mood_gain:.3f}")
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def feedback_to_mood(self, mood_value):
|
||||||
|
"""对情绪的反馈"""
|
||||||
|
coefficient = self.gain_coefficient[abs(self.positive_feedback_value)]
|
||||||
|
if (mood_value > 0 and self.positive_feedback_value > 0
|
||||||
|
or mood_value < 0 and self.positive_feedback_value < 0):
|
||||||
|
return mood_value*coefficient
|
||||||
|
else:
|
||||||
|
return mood_value/coefficient
|
||||||
|
|
||||||
async def calculate_update_relationship_value(self, chat_stream: ChatStream, label: str, stance: str) -> None:
|
async def calculate_update_relationship_value(self, chat_stream: ChatStream, label: str, stance: str) -> None:
|
||||||
"""计算并变更关系值
|
"""计算并变更关系值
|
||||||
|
|||||||
Reference in New Issue
Block a user