diff --git a/douzero/server/battle.py b/douzero/server/battle.py index 5eda2aa..0046b72 100644 --- a/douzero/server/battle.py +++ b/douzero/server/battle.py @@ -90,6 +90,7 @@ def battle_logic(flags, baseline : Baseline, battle : Battle): Baseline.create(**challenger_baseline) 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.opponent_rank = baseline.rank battle.status = 1 if challenge_success else 2 battle.save() if not challenge_success: diff --git a/douzero/server/orm.py b/douzero/server/orm.py index 24a44a7..9e66c45 100644 --- a/douzero/server/orm.py +++ b/douzero/server/orm.py @@ -28,6 +28,7 @@ class Battle(BaseModel): id = PrimaryKeyField() challenger_path = CharField(null = False, index = True) challenger_position = CharField(null = False) + opponent_rank = IntegerField(null = False) status = IntegerField(null = False, index = True) challenger_wp = DecimalField(null=True) challenger_adp = DecimalField(null=True) diff --git a/evaluate_server.py b/evaluate_server.py index 70cc25d..1c1cc99 100644 --- a/evaluate_server.py +++ b/evaluate_server.py @@ -275,7 +275,7 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='DouZero evaluation backend') parser.add_argument('--debug', action='store_true') 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_schema', type=str, default='dou_model') parser.add_argument('--db_user', type=str, default='douzero') diff --git a/static/charts.html b/static/charts.html index 59f8577..da6c605 100644 --- a/static/charts.html +++ b/static/charts.html @@ -47,6 +47,7 @@ result[rank]['baseline'].landlord_up_path }, colors: ['#e02f1b', '#a82314', '#1be02f', '#14a823', '#1bcce0', '#1499a8', '#2f1be0', '#2314a8'], + symbols: ['circle', 'circle', 'triangle-down', 'triangle-down', 'square', 'square', 'triangle', 'triangle'], yAxis: [ { title: {text: 'Win Rate (%)'},