调整图表,添加字段

This commit is contained in:
zhiyang7 2021-12-29 16:48:32 +08:00
parent b717c48ece
commit e8e6bf8f59
4 changed files with 4 additions and 1 deletions

View File

@ -90,6 +90,7 @@ def battle_logic(flags, baseline : Baseline, battle : Battle):
Baseline.create(**challenger_baseline) Baseline.create(**challenger_baseline)
battle.challenger_wp = landlord_wp if battle.challenger_position == 'landlord' else farmer_wp battle.challenger_wp = landlord_wp if battle.challenger_position == 'landlord' else farmer_wp
battle.challenger_adp = landlord_adp if battle.challenger_position == 'landlord' else farmer_adp battle.challenger_adp = landlord_adp if battle.challenger_position == 'landlord' else farmer_adp
battle.opponent_rank = baseline.rank
battle.status = 1 if challenge_success else 2 battle.status = 1 if challenge_success else 2
battle.save() battle.save()
if not challenge_success: if not challenge_success:

View File

@ -28,6 +28,7 @@ class Battle(BaseModel):
id = PrimaryKeyField() id = PrimaryKeyField()
challenger_path = CharField(null = False, index = True) challenger_path = CharField(null = False, index = True)
challenger_position = CharField(null = False) challenger_position = CharField(null = False)
opponent_rank = IntegerField(null = False)
status = IntegerField(null = False, index = True) status = IntegerField(null = False, index = True)
challenger_wp = DecimalField(null=True) challenger_wp = DecimalField(null=True)
challenger_adp = DecimalField(null=True) challenger_adp = DecimalField(null=True)

View File

@ -275,7 +275,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(description='DouZero evaluation backend') parser = argparse.ArgumentParser(description='DouZero evaluation backend')
parser.add_argument('--debug', action='store_true') parser.add_argument('--debug', action='store_true')
parser.add_argument('--enable_task', type=bool) parser.add_argument('--enable_task', type=bool)
parser.add_argument('--update_threshold', type=float, default=0.06) parser.add_argument('--update_threshold', type=float, default=0.09)
parser.add_argument('--db_host', type=str, default='127.0.0.1') parser.add_argument('--db_host', type=str, default='127.0.0.1')
parser.add_argument('--db_schema', type=str, default='dou_model') parser.add_argument('--db_schema', type=str, default='dou_model')
parser.add_argument('--db_user', type=str, default='douzero') parser.add_argument('--db_user', type=str, default='douzero')

View File

@ -47,6 +47,7 @@
result[rank]['baseline'].landlord_up_path result[rank]['baseline'].landlord_up_path
}, },
colors: ['#e02f1b', '#a82314', '#1be02f', '#14a823', '#1bcce0', '#1499a8', '#2f1be0', '#2314a8'], colors: ['#e02f1b', '#a82314', '#1be02f', '#14a823', '#1bcce0', '#1499a8', '#2f1be0', '#2314a8'],
symbols: ['circle', 'circle', 'triangle-down', 'triangle-down', 'square', 'square', 'triangle', 'triangle'],
yAxis: [ yAxis: [
{ {
title: {text: 'Win Rate (%)'}, title: {text: 'Win Rate (%)'},