fix:修复关系炸裂

This commit is contained in:
SengokuCola
2025-06-15 19:28:54 +08:00
parent 7f19255c99
commit ccf5092116

View File

@@ -851,7 +851,7 @@ class NormalChat:
reply_ratio = reply_count / total_messages if total_messages > 0 else 0 reply_ratio = reply_count / total_messages if total_messages > 0 else 0
# 使用对数函数让低比率时概率上升更快log(1 + ratio * k) / log(1 + k) + base # 使用对数函数让低比率时概率上升更快log(1 + ratio * k) / log(1 + k) + base
# k=7时0.05比率对应约0.4概率0.1比率对应约0.6概率0.2比率对应约0.8概率 # k=7时0.05比率对应约0.4概率0.1比率对应约0.6概率0.2比率对应约0.8概率
k_reply = 7 * global_config.normal_chat.relation_frequency k_reply = 7 * global_config.relationship.relation_frequency
base_reply_prob = 0.1 # 基础概率10% base_reply_prob = 0.1 # 基础概率10%
reply_build_probability = ( reply_build_probability = (
(math.log(1 + reply_ratio * k_reply) / math.log(1 + k_reply)) * 0.9 + base_reply_prob (math.log(1 + reply_ratio * k_reply) / math.log(1 + k_reply)) * 0.9 + base_reply_prob
@@ -862,7 +862,7 @@ class NormalChat:
# 计算接收概率receive_count的影响 # 计算接收概率receive_count的影响
receive_ratio = receive_count / total_messages if total_messages > 0 else 0 receive_ratio = receive_count / total_messages if total_messages > 0 else 0
# 接收概率使用更温和的对数曲线最大0.5基础0.08 # 接收概率使用更温和的对数曲线最大0.5基础0.08
k_receive = 6 * global_config.normal_chat.relation_frequency k_receive = 6 * global_config.relationship.relation_frequency
base_receive_prob = 0.08 # 基础概率8% base_receive_prob = 0.08 # 基础概率8%
receive_build_probability = ( receive_build_probability = (
(math.log(1 + receive_ratio * k_receive) / math.log(1 + k_receive)) * 0.42 + base_receive_prob (math.log(1 + receive_ratio * k_receive) / math.log(1 + k_receive)) * 0.42 + base_receive_prob