修改上次提交产生的bug

This commit is contained in:
meng_xi_pan
2025-04-16 11:29:43 +08:00
parent 0bba90b48c
commit def7e7a000

View File

@@ -85,9 +85,9 @@ class MxpWillingManager(BaseWillingManager):
rel_level = self._get_relationship_level_num(rel_value) rel_level = self._get_relationship_level_num(rel_value)
self.chat_person_reply_willing[w_info.chat_id][w_info.person_id] += rel_level * 0.05 self.chat_person_reply_willing[w_info.chat_id][w_info.person_id] += rel_level * 0.05
now_chat_new_person = self.last_response_person.get(w_info.chat_id, ["", 0]) now_chat_new_person = self.last_response_person.get(w_info.chat_id, [w_info.person_id, 0])
if now_chat_new_person[0] == w_info.person_id: if now_chat_new_person[0] == w_info.person_id:
if now_chat_new_person[1] < 2: if now_chat_new_person[1] < 3:
now_chat_new_person[1] += 1 now_chat_new_person[1] += 1
else: else:
self.last_response_person[w_info.chat_id] = [w_info.person_id, 0] self.last_response_person[w_info.chat_id] = [w_info.person_id, 0]
@@ -101,9 +101,10 @@ class MxpWillingManager(BaseWillingManager):
if ( if (
w_info.chat_id in self.last_response_person w_info.chat_id in self.last_response_person
and self.last_response_person[w_info.chat_id][0] == w_info.person_id and self.last_response_person[w_info.chat_id][0] == w_info.person_id
and self.last_response_person[w_info.chat_id][1]
): ):
self.chat_person_reply_willing[w_info.chat_id][w_info.person_id] += self.single_chat_gain * ( self.chat_person_reply_willing[w_info.chat_id][w_info.person_id] += self.single_chat_gain * (
2 * self.last_response_person[w_info.chat_id][1] + 1 2 * self.last_response_person[w_info.chat_id][1] - 1
) )
now_chat_new_person = self.last_response_person.get(w_info.chat_id, ["", 0]) now_chat_new_person = self.last_response_person.get(w_info.chat_id, ["", 0])
if now_chat_new_person[0] != w_info.person_id: if now_chat_new_person[0] != w_info.person_id:
@@ -133,16 +134,17 @@ class MxpWillingManager(BaseWillingManager):
rel_value = await w_info.person_info_manager.get_value(w_info.person_id, "relationship_value") rel_value = await w_info.person_info_manager.get_value(w_info.person_id, "relationship_value")
rel_level = self._get_relationship_level_num(rel_value) rel_level = self._get_relationship_level_num(rel_value)
current_willing += rel_level * 0.1 current_willing += rel_level * 0.1
if self.is_debug: if self.is_debug and rel_level != 0:
self.logger.debug(f"关系增益:{rel_level * 0.1}") self.logger.debug(f"关系增益:{rel_level * 0.1}")
if ( if (
w_info.chat_id in self.last_response_person w_info.chat_id in self.last_response_person
and self.last_response_person[w_info.chat_id][0] == w_info.person_id and self.last_response_person[w_info.chat_id][0] == w_info.person_id
and self.last_response_person[w_info.chat_id][1]
): ):
current_willing += self.single_chat_gain * (2 * self.last_response_person[w_info.chat_id][1] + 1) current_willing += self.single_chat_gain * (2 * self.last_response_person[w_info.chat_id][1] + 1)
if self.is_debug: if self.is_debug:
self.logger.debug(f"单聊增益:{self.single_chat_gain * (2 * self.last_response_person[w_info.chat_id][1] + 1)}") self.logger.debug(f"单聊增益:{self.single_chat_gain * (2 * self.last_response_person[w_info.chat_id][1] - 1)}")
current_willing += self.chat_fatigue_willing_attenuation.get(w_info.chat_id, 0) current_willing += self.chat_fatigue_willing_attenuation.get(w_info.chat_id, 0)
if self.is_debug: if self.is_debug:
@@ -222,8 +224,12 @@ class MxpWillingManager(BaseWillingManager):
self.chat_new_message_time[chat.stream_id].pop(0) self.chat_new_message_time[chat.stream_id].pop(0)
if chat.stream_id not in self.chat_fatigue_punishment_list: if chat.stream_id not in self.chat_fatigue_punishment_list:
self.chat_fatigue_punishment_list[chat.stream_id] = [current_time, self.chat_fatigue_punishment_list[chat.stream_id] = [
self.number_of_message_storage * self.basic_maximum_willing / self.expected_replies_per_min * 60] (current_time, self.number_of_message_storage * self.basic_maximum_willing / self.expected_replies_per_min * 60)
]
self.chat_fatigue_willing_attenuation[chat.stream_id] = - 2 * self.basic_maximum_willing
def _willing_to_probability(self, willing: float) -> float: def _willing_to_probability(self, willing: float) -> float:
"""意愿值转化为概率""" """意愿值转化为概率"""