修改上次提交产生的bug
This commit is contained in:
@@ -85,9 +85,9 @@ class MxpWillingManager(BaseWillingManager):
|
||||
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
|
||||
|
||||
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[1] < 2:
|
||||
if now_chat_new_person[1] < 3:
|
||||
now_chat_new_person[1] += 1
|
||||
else:
|
||||
self.last_response_person[w_info.chat_id] = [w_info.person_id, 0]
|
||||
@@ -101,9 +101,10 @@ class MxpWillingManager(BaseWillingManager):
|
||||
if (
|
||||
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][1]
|
||||
):
|
||||
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])
|
||||
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_level = self._get_relationship_level_num(rel_value)
|
||||
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}")
|
||||
|
||||
if (
|
||||
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][1]
|
||||
):
|
||||
current_willing += self.single_chat_gain * (2 * self.last_response_person[w_info.chat_id][1] + 1)
|
||||
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)
|
||||
if self.is_debug:
|
||||
@@ -222,8 +224,12 @@ class MxpWillingManager(BaseWillingManager):
|
||||
self.chat_new_message_time[chat.stream_id].pop(0)
|
||||
|
||||
if chat.stream_id not in self.chat_fatigue_punishment_list:
|
||||
self.chat_fatigue_punishment_list[chat.stream_id] = [current_time,
|
||||
self.number_of_message_storage * self.basic_maximum_willing / self.expected_replies_per_min * 60]
|
||||
self.chat_fatigue_punishment_list[chat.stream_id] = [
|
||||
(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:
|
||||
"""意愿值转化为概率"""
|
||||
|
||||
Reference in New Issue
Block a user