修复了不能管顺子的bug,并且优化了resnet模型的性能。
This commit is contained in:
Vincentzyx 2021-11-03 15:56:28 +08:00
parent 7f3e086437
commit dc45da771c
2 changed files with 22 additions and 17 deletions

26
douzero/env/game.py vendored
View File

@ -58,10 +58,10 @@ class GameEnv(object):
self.bomb_num = 0
self.last_pid = 'landlord'
self.bid_info = [[-1, -1, -1],
[-1, -1, -1],
[-1, -1, -1],
[-1, -1, -1]]
self.bid_info = [[1, 1, 1],
[1, 1, 1],
[1, 1, 1],
[1, 1, 1]]
self.bid_count = 0
self.multiply_count = {'landlord': 1,
'landlord_up': 1,
@ -339,10 +339,10 @@ class GameEnv(object):
self.bomb_num = 0
self.last_pid = 'landlord'
self.bid_info = [[-1, -1, -1],
[-1, -1, -1],
[-1, -1, -1],
[-1, -1, -1]]
self.bid_info = [[1, 1, 1],
[1, 1, 1],
[1, 1, 1],
[1, 1, 1]]
self.bid_count = 0
self.multiply_count = {'landlord': 0,
'landlord_up': 0,
@ -445,11 +445,11 @@ class InfoSet(object):
# The number of bombs played so far
self.bomb_num = None
self.bid_info = [[-1, -1, -1],
[-1, -1, -1],
[-1, -1, -1],
[-1, -1, -1]]
self.bid_info = [[1, 1, 1],
[1, 1, 1],
[1, 1, 1],
[1, 1, 1]]
self.multiply_info = [1, 0, 0]
self.multiply_info = [1, 1, 1]
self.player_id = None

11
main.py
View File

@ -75,11 +75,12 @@ class MyPyQT_Form(QtWidgets.QWidget, Ui_Form):
self.RunGame = False
self.AutoPlay = False
self.BidThreshold1 = 65 # 叫地主阈值
self.BidThreshold2 = 75 # 抢地主阈值
self.BidThreshold2 = 72 # 抢地主阈值
self.JiabeiThreshold = (
(80, 65), # 叫地主 超级加倍 加倍 阈值
(85, 70) # 叫地主 超级加倍 加倍 阈值 (在地主是抢来的情况下)
(85, 72), # 叫地主 超级加倍 加倍 阈值
(85, 75) # 叫地主 超级加倍 加倍 阈值 (在地主是抢来的情况下)
)
self.MingpaiThreshold = 92
# 坐标
self.MyHandCardsPos = (250, 764, 1141, 70) # 我的截图区域
self.LPlayedCardsPos = (463, 355, 380, 250) # 左边截图区域
@ -286,6 +287,7 @@ class MyPyQT_Form(QtWidgets.QWidget, Ui_Form):
self.other_played_cards_real = ""
print("\n下家出牌:", self.other_played_cards_real)
self.other_played_cards_env = [RealCard2EnvCard[c] for c in list(self.other_played_cards_real)]
self.other_played_cards_env.sort()
self.env.step(self.user_position, self.other_played_cards_env)
# 更新界面
self.RPlayedCard.setText(self.other_played_cards_real if self.other_played_cards_real else "不出")
@ -316,6 +318,7 @@ class MyPyQT_Form(QtWidgets.QWidget, Ui_Form):
self.other_played_cards_real = ""
print("\n上家出牌:", self.other_played_cards_real)
self.other_played_cards_env = [RealCard2EnvCard[c] for c in list(self.other_played_cards_real)]
self.other_played_cards_env.sort()
self.env.step(self.user_position, self.other_played_cards_env)
self.play_order = 0
# 更新界面
@ -559,6 +562,8 @@ class MyPyQT_Form(QtWidgets.QWidget, Ui_Form):
self.sleep(7000)
else:
self.sleep(2000)
if win_rate > self.MingpaiThreshold:
helper.ClickOnImage("mingpai_btn", region=self.GeneralBtnPos)
self.init_cards()