添加叫牌相关的评估逻辑

This commit is contained in:
zhiyang7 2021-12-10 10:11:44 +08:00
parent 0df61c62e3
commit 3300fd9658
3 changed files with 33 additions and 16 deletions

11
douzero/env/game.py vendored
View File

@ -86,6 +86,17 @@ class GameEnv(object):
def card_play_init(self, card_play_data):
if 'bid' in card_play_data.keys():
self.info_sets['landlord'].bid_info = card_play_data['bid']['landlord']
self.info_sets['landlord_up'].bid_info = card_play_data['bid']['landlord_up']
self.info_sets['landlord_front'].bid_info = card_play_data['bid']['landlord_front']
self.info_sets['landlord_down'].bid_info = card_play_data['bid']['landlord_down']
self.info_sets['landlord'].player_hand_cards = card_play_data['play']['landlord']
self.info_sets['landlord_up'].player_hand_cards = card_play_data['play']['landlord_up']
self.info_sets['landlord_front'].player_hand_cards = card_play_data['play']['landlord_front']
self.info_sets['landlord_down'].player_hand_cards = card_play_data['play']['landlord_down']
else:
self.info_sets['landlord'].player_hand_cards = \
card_play_data['landlord']
self.info_sets['landlord_up'].player_hand_cards = \

View File

@ -85,6 +85,12 @@ def mp_simulate(card_play_data_list, card_play_model_path_dict, q, output, bid_o
print(" bid: %i|%i%i|%i%i|%i (%.3f %.3f %.3f %.3f %.3f %.3f) %.1f" % (bid_results[0],bid_results[1],bid_results[2],bid_results[3],bid_results[4],bid_results[5],bid_values[0],bid_values[1],bid_values[2],bid_values[3],bid_values[4],bid_values[5], result2))
if output and not bid_output:
print("\nStart ------- " + title)
if 'play' in card_play_data.keys():
print ("".join([EnvCard2RealCard[c] for c in card_play_data['play']["landlord"]]))
print ("".join([EnvCard2RealCard[c] for c in card_play_data['play']["landlord_down"]]))
print ("".join([EnvCard2RealCard[c] for c in card_play_data['play']["landlord_front"]]))
print ("".join([EnvCard2RealCard[c] for c in card_play_data['play']["landlord_up"]]))
else:
print ("".join([EnvCard2RealCard[c] for c in card_play_data["landlord"]]))
print ("".join([EnvCard2RealCard[c] for c in card_play_data["landlord_down"]]))
print ("".join([EnvCard2RealCard[c] for c in card_play_data["landlord_front"]]))

View File

@ -15,9 +15,9 @@ deck.extend([20, 20, 30, 30])
def get_parser():
parser = argparse.ArgumentParser(description='DouZero: random data generator')
parser.add_argument('--output', default='eval_data', type=str)
parser.add_argument('--path', default='baselines/resnet_bidding_15419200.ckpt', type=str)
parser.add_argument('--num_games', default=10000, type=int)
parser.add_argument('--output', default='eval_data_200', type=str)
parser.add_argument('--path', default='baselines/resnet_bidding_27853600.ckpt', type=str)
parser.add_argument('--num_games', default=200, type=int)
parser.add_argument('--exp_epsilon', default=0.01, type=float)
return parser