add wos award

This commit is contained in:
wjsjwr 2022-07-24 23:24:07 +08:00
parent 8c2f24ee09
commit f7bd06f58c
26 changed files with 498606 additions and 2 deletions

1
outputs/THETA_NEW_BA.csv Normal file
View File

@ -0,0 +1 @@
1221.2386363636363,1163.7443181818182,1186.4147727272727,1163.4943181818182,1170.2670454545455,1144.4943181818182,1050.6761363636363,1182.8125,1070.0568181818182,1123.6931818181818,1240.5738636363637,1161.4488636363637,1203.4941176470588,0.0,0.0,0.0
1 1221.2386363636363 1163.7443181818182 1186.4147727272727 1163.4943181818182 1170.2670454545455 1144.4943181818182 1050.6761363636363 1182.8125 1070.0568181818182 1123.6931818181818 1240.5738636363637 1161.4488636363637 1203.4941176470588 0.0 0.0 0.0

1
outputs/THETA_NEW_WS.csv Normal file
View File

@ -0,0 +1 @@
1435.4651162790697,1425.843023255814,1429.9883720930231,1429.0697674418604,1435.5755813953488,1427.6744186046512,1431.9011627906978,1434.0755813953488,1433.7093023255813,1433.7209302325582,1432.9941860465117,1438.953488372093,1427.6744186046512,1436.551724137931,1431.7241379310344,0.0
1 1435.4651162790697 1425.843023255814 1429.9883720930231 1429.0697674418604 1435.5755813953488 1427.6744186046512 1431.9011627906978 1434.0755813953488 1433.7093023255813 1433.7209302325582 1432.9941860465117 1438.953488372093 1427.6744186046512 1436.551724137931 1431.7241379310344 0.0

View File

@ -26,6 +26,6 @@ ax.set_ylabel(r"$\theta$", family='sans-serif', size=22)
plt.legend(numpoints=2, fontsize=14)
plt.tight_layout()
plt.show()
# plt.show()
# plt.savefig("graph/theta_plot.eps")
# plt.savefig("graph/theta_plot_new.pdf")
plt.savefig("graph/theta_plot_new.pdf")

33211
wos-award/G646.json Normal file

File diff suppressed because it is too large Load Diff

69537
wos-award/G903.json Normal file

File diff suppressed because it is too large Load Diff

25957
wos-award/G916.json Normal file

File diff suppressed because it is too large Load Diff

21961
wos-award/G927.json Normal file

File diff suppressed because it is too large Load Diff

25416
wos-award/G933.json Normal file

File diff suppressed because it is too large Load Diff

19820
wos-award/G936.json Normal file

File diff suppressed because it is too large Load Diff

7073
wos-award/G937.json Normal file

File diff suppressed because it is too large Load Diff

BIN
wos-award/G937.json.gz Normal file

Binary file not shown.

4053
wos-award/G943.json Normal file

File diff suppressed because it is too large Load Diff

BIN
wos-award/G943.json.gz Normal file

Binary file not shown.

8374
wos-award/G945.json Normal file

File diff suppressed because it is too large Load Diff

BIN
wos-award/G945.json.gz Normal file

Binary file not shown.

25
wos-award/o.csv Normal file
View File

@ -0,0 +1,25 @@
提交者(自动),提交时间(自动),你在策略战争微信群中的昵称(必填),你在策略战争平台的注册邮箱(必填),你在策略战争平台上的昵称(必填),uid,场次,轮数,食物,轮均,名次奖励
木木FT,2022/4/24 22:53,木木FT,317227619@qq.com,木木,363,2,0,0,0,
HL,2022/4/24 22:54,李辉,1652286@tongji.edu.cn,李辉,260,4,0,0,0,
对方正在输入...,2022/4/24 22:54,您真牛啊,lin1795829528@vip.qq.com,您真牛啊,354,8,10,50.01,5,300
,2022/4/24 22:54,yan,851584208@qq.com,yan,421,4,28,81.01,2.89,
luwen,2022/4/24 22:54,luwen,shanjubiji@126.com,luwen,413,9,10,30.01,3,
张余歌,2022/4/24 22:55,张余歌,1227680236@qq.com,24ukong,397,5,11,32.01,2.91,
Shmily,2022/4/24 22:57,Shmily,wentaogao@tongji.edu.cn,wentaogao,390,6,0,0,0,
鹿衔,2022/4/24 22:58,鹿衔,617909747@qq.com,一芝小脑斧,383,1,0,0,0,
Nebula,2022/4/24 22:58,Nebula,1246767047@qq.com,Nebula,419,1,0,0,0,
星野爱学习,2022/4/24 22:59,星野爱学习,3417319963@qq.com,洛武司靼敌,315,4,28,80.26,2.87,
瓜洲渡,2022/4/24 23:12,瓜洲渡,906207351@qq.com,瓜洲渡,375,2,0,0,0,
朽油盖,2022/4/24 23:13,浊酒,2278207907@qq.com,浊酒,329,3,0,0,0,
祺,2022/4/24 23:15,祺,666@qq.com,qi,266,5,28,78.04,2.79,
sc🐟,2022/4/24 23:31,sc🐟 ,2605166556@qq.com,raganoros,360,8,28,126.01,4.5,200
Alley,2022/4/25 7:18,虫二,3569612650@qq.com,李哈哈,387,1,0,0,0,
白驹,2022/4/25 9:36,白驹,1900036514@qq.com,陈晓宇,342,3,0,0,0,
角落,2022/4/25 9:43,角落,1628966701@qq.com,Kirsi,361,8,10,31.86,3.19,
朱sir.,2022/4/25 14:21,朱sir.,3327078581@qq.com,雷神的小锤子,359,8,26,112.48,4.33,100
牛韶源,2022/4/25 17:25,牛韶源,sy_niu_tongji@tongji.edu.cn,niuniuniu,335,3,0,0,0,
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
,,,,,,,,,,
,,总计=鼓励奖+名次奖,685,,,,,,,
1 提交者(自动) 提交时间(自动) 你在策略战争微信群中的昵称(必填) 你在策略战争平台的注册邮箱(必填) 你在策略战争平台上的昵称(必填) uid 场次 轮数 食物 轮均 名次奖励
2 木木FT 2022/4/24 22:53 木木FT 317227619@qq.com 木木 363 2 0 0 0
3 HL 2022/4/24 22:54 李辉 1652286@tongji.edu.cn 李辉 260 4 0 0 0
4 对方正在输入... 2022/4/24 22:54 您真牛啊 lin1795829528@vip.qq.com 您真牛啊 354 8 10 50.01 5 300
5 2022/4/24 22:54 yan 851584208@qq.com yan 421 4 28 81.01 2.89
6 luwen 2022/4/24 22:54 luwen shanjubiji@126.com luwen 413 9 10 30.01 3
7 张余歌 2022/4/24 22:55 张余歌 1227680236@qq.com 24ukong 397 5 11 32.01 2.91
8 Shmily 2022/4/24 22:57 Shmily wentaogao@tongji.edu.cn wentaogao 390 6 0 0 0
9 鹿衔 2022/4/24 22:58 鹿衔 617909747@qq.com 一芝小脑斧 383 1 0 0 0
10 Nebula 2022/4/24 22:58 Nebula 1246767047@qq.com Nebula 419 1 0 0 0
11 星野爱学习 2022/4/24 22:59 星野爱学习 3417319963@qq.com 洛武司靼敌 315 4 28 80.26 2.87
12 瓜洲渡 2022/4/24 23:12 瓜洲渡 906207351@qq.com 瓜洲渡 375 2 0 0 0
13 朽油盖 2022/4/24 23:13 浊酒 2278207907@qq.com 浊酒 329 3 0 0 0
14 2022/4/24 23:15 666@qq.com qi 266 5 28 78.04 2.79
15 sc🐟 2022/4/24 23:31 sc🐟 2605166556@qq.com raganoros 360 8 28 126.01 4.5 200
16 Alley 2022/4/25 7:18 虫二 3569612650@qq.com 李哈哈 387 1 0 0 0
17 白驹 2022/4/25 9:36 白驹 1900036514@qq.com 陈晓宇 342 3 0 0 0
18 角落 2022/4/25 9:43 角落 1628966701@qq.com Kirsi 361 8 10 31.86 3.19
19 朱sir. 2022/4/25 14:21 朱sir. 3327078581@qq.com 雷神的小锤子 359 8 26 112.48 4.33 100
20 牛韶源 2022/4/25 17:25 牛韶源 sy_niu_tongji@tongji.edu.cn niuniuniu 335 3 0 0 0
21
22
23
24
25 总计=鼓励奖+名次奖 685

33
wos-award/p.py Normal file
View File

@ -0,0 +1,33 @@
import json
import glob
played = {}
for fn in glob.glob("*.json", recursive=False):
with open(fn, encoding='utf-8') as f:
data = json.load(f)
for r in data:
if r['cat'] == 'player' and r['act'] == 'join':
if r['uid'] not in played:
played[r['uid']] = 0
played[r['uid']] += 1
kv = {}
with open('s.csv', encoding='utf-8') as f:
for l in f:
r = l.strip().split(',')
kv[f'{r[1].upper()}-{r[2].upper()}'] = dict(uid=int(r[0]),rest=r[3:])
with open('u.csv', encoding='utf-8') as fin:
with open('o.csv', 'w', encoding='utf-8') as fout:
for l in fin:
r = l.strip().split(',')
key=f'{r[-1].upper()}-{r[-2].upper()}'
if key not in kv:
print(f'!!!!!!MISSING #{key}')
continue
uid = kv[key]['uid']
out = ','.join([l.strip(),f'{uid}',f'{played[uid]}',*kv[key]['rest']])
fout.write(out + '\n')
print(out)

75059
wos-award/part2/G1142.json Normal file

File diff suppressed because it is too large Load Diff

62973
wos-award/part2/G1156.json Normal file

File diff suppressed because it is too large Load Diff

82719
wos-award/part2/G1162.json Normal file

File diff suppressed because it is too large Load Diff

61161
wos-award/part2/G975.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
import json
import glob
winner = {}
pid2uid = {}
score = {}
act_set = {'accept_failed', 'request', 'deny'}
to_print = [359, 502, 413, 512, 460, 451, 473, 511, 489, 255, 342, 481]
username = {}
username[359] = '雷神的小锤子'
username[502] = '囚徒困境'
username[413] = 'luwen'
username[512] = 'Richard'
username[460] = 'CHYK'
username[451] = '海丽可可'
username[473] = 'fyl'
username[511] = '赵子截江夺阿斗'
username[489] = 'J'
username[255] = 'gly'
username[342] = '陈晓宇'
username[481] = 'Arthur'
G_NAME = dict(G975=1, G1142=2, G1156=3, G1162=4)
G=['G975.json','G1142.json','G1156.json','G1162.json']
for fn in glob.glob("*.json", recursive=False):
with open(fn, encoding='utf-8') as f:
data = json.load(f)
total_round = int(data[0]['info']['game_end_at'])
uids = {}
for r in data[::-1]:
if r['cat'] == 'game' and r['act'] == 'winner':
for uid in r['data']:
uids[uid] = dict(h=[[] for _ in range(total_round)])
break
for uid, d in uids.items():
if uid not in winner:
winner[uid] = {}
for r in data:
if r['cat'] == 'player' and r['act'] == 'join':
if r['uid'] in uids:
pid2uid[r['pid']] = r['uid']
winner[r['uid']][fn] = uids[r['uid']] | {'p': r['pid']}
if r['cat'] == 'action':
if r['act'] == 'done':
if r['a'] in pid2uid:
winner[pid2uid[r['a']]][fn]['h'][r['rno']-1].append(r)
elif r['b'] in pid2uid:
winner[pid2uid[r['b']]][fn]['h'][r['rno']-1].append(r)
elif r['act'] in act_set:
if r['from'] in pid2uid:
winner[pid2uid[r['from']]][fn]['h'][r['rno']-1].append(r)
# print(winner.keys())
symbol = dict(D='🔪',C='🤝')
ACT_DONE = "%d. TA出了%s,对方%d出了%s,消耗时间资源%d"
with open("result.txt", "w", encoding="utf-8") as f:
for uid in to_print:
if uid not in winner:
continue
print("\n\n玩家:", username[uid], file=f)
for g in G:
if g not in winner[uid]:
continue
data = winner[uid][g]
print("在第%d场比赛中获胜" % G_NAME[g.split('.')[0]], file=f)
for i, h in enumerate(data['h']):
print("%d轮:" % (i+1), file=f)
for j, r in enumerate(h):
if r['act'] == 'done':
if r['a'] == data['p']:
print(ACT_DONE % (j+1, symbol[r['act_a']], r['b'], symbol[r['act_b']], r['tr']), file=f)
else:
print(ACT_DONE % (j+1, symbol[r['act_b']], r['a'], symbol[r['act_a']], r['tr']), file=f)
elif r['act'] == 'accept_failed':
print("%d. TA因为时间资源不足不得不拒绝了%d" % (j+1, r['to']), file=f)
elif r['act'] == 'request':
print("%d. TA向%d发出了%s请求,时间资源%d" % (j+1, r['to'], symbol[r['action']], r['tr']), file=f)
elif r['act'] == 'deny':
print("%d. TA拒绝了%d的博弈请求。" % (j+1, r['to']), file=f)

1104
wos-award/part2/result.txt Normal file

File diff suppressed because it is too large Load Diff

1
wos-award/q.sh Normal file
View File

@ -0,0 +1 @@
for l in $(cat u.csv); do IFS=',' read -a data <<< "$l"; psql -t -A -F "," -c '\x' -c "SELECT user_id,username,email,total_wins,total_food,average_food FROM users WHERE LOWER(email)=LOWER('${data[2]}') AND LOWER(username)=LOWER('${data[3]}');" $WOS_DB_CONNECT; done

19
wos-award/s.csv Normal file
View File

@ -0,0 +1,19 @@
363,木木,317227619@qq.com,0,0.00,0.00
260,李辉,1652286@tongji.edu.cn,0,0.00,0.00
354,您真牛啊,lin1795829528@vip.qq.com,10,50.01,5.00
421,yan,851584208@qq.com,28,81.01,2.89
413,luwen,shanjubiji@126.com,10,30.01,3.00
397,24ukong,1227680236@qq.com,11,32.01,2.91
390,wentaogao,wentaogao@tongji.edu.cn,0,0.00,0.00
383,一芝小脑斧,617909747@qq.com,0,0.00,0.00
419,NEBULA,1246767047@qq.com,0,0.00,0.00
315,洛武司靼敌,3417319963@qq.com,28,80.26,2.87
375,瓜洲渡,906207351@qq.com,0,0.00,0.00
329,浊酒,2278207907@qq.com,0,0.00,0.00
266,qi,666@qq.com,28,78.04,2.79
360,raganoros,2605166556@qq.com,28,126.01,4.50
387,李哈哈,3569612650@qq.com,0,0.00,0.00
342,陈晓宇,1900036514@qq.com,0,0.00,0.00
361,Kirsi,1628966701@qq.com,10,31.86,3.19
359,雷神的小锤子,3327078581@qq.com,26,112.48,4.33
335,niuniuniu,sy_niu_tongji@tongji.edu.cn,0,0.00,0.00
1 363 木木 317227619@qq.com 0 0.00 0.00
2 260 李辉 1652286@tongji.edu.cn 0 0.00 0.00
3 354 您真牛啊 lin1795829528@vip.qq.com 10 50.01 5.00
4 421 yan 851584208@qq.com 28 81.01 2.89
5 413 luwen shanjubiji@126.com 10 30.01 3.00
6 397 24ukong 1227680236@qq.com 11 32.01 2.91
7 390 wentaogao wentaogao@tongji.edu.cn 0 0.00 0.00
8 383 一芝小脑斧 617909747@qq.com 0 0.00 0.00
9 419 NEBULA 1246767047@qq.com 0 0.00 0.00
10 315 洛武司靼敌 3417319963@qq.com 28 80.26 2.87
11 375 瓜洲渡 906207351@qq.com 0 0.00 0.00
12 329 浊酒 2278207907@qq.com 0 0.00 0.00
13 266 qi 666@qq.com 28 78.04 2.79
14 360 raganoros 2605166556@qq.com 28 126.01 4.50
15 387 李哈哈 3569612650@qq.com 0 0.00 0.00
16 342 陈晓宇 1900036514@qq.com 0 0.00 0.00
17 361 Kirsi 1628966701@qq.com 10 31.86 3.19
18 359 雷神的小锤子 3327078581@qq.com 26 112.48 4.33
19 335 niuniuniu sy_niu_tongji@tongji.edu.cn 0 0.00 0.00

19
wos-award/u.csv Normal file
View File

@ -0,0 +1,19 @@
木木FT,2022/4/24 22:53:54,木木FT,317227619@qq.com,木木
HL,2022/4/24 22:54:19,李辉,1652286@tongji.edu.cn,李辉
对方正在输入...,2022/4/24 22:54:25,您真牛啊,lin1795829528@vip.qq.com,您真牛啊
,2022/4/24 22:54:41,yan,851584208@qq.com,yan
luwen,2022/4/24 22:54:53,luwen,shanjubiji@126.com,luwen
张余歌,2022/4/24 22:55:57,张余歌,1227680236@qq.com,24ukong
Shmily,2022/4/24 22:57:37,Shmily,wentaogao@tongji.edu.cn,wentaogao
鹿衔,2022/4/24 22:58:02,鹿衔,617909747@qq.com,一芝小脑斧
Nebula,2022/4/24 22:58:52,Nebula,1246767047@qq.com,Nebula
星野爱学习,2022/4/24 22:59:04,星野爱学习,3417319963@qq.com,洛武司靼敌
瓜洲渡,2022/4/24 23:12:35,瓜洲渡,906207351@qq.com,瓜洲渡
朽油盖,2022/4/24 23:13:26,浊酒,2278207907@qq.com,浊酒
祺,2022/4/24 23:15:20,祺,666@qq.com,qi
sc🐟,2022/4/24 23:31:21,sc🐟 ,2605166556@qq.com,raganoros
Alley,2022/4/25 7:18:06,虫二,3569612650@qq.com,李哈哈
白驹,2022/4/25 9:36:45,白驹,1900036514@qq.com,陈晓宇
角落,2022/4/25 9:43:39,角落,1628966701@qq.com,Kirsi
朱sir.,2022/4/25 14:21:17,朱sir.,3327078581@qq.com,雷神的小锤子
牛韶源,2022/4/25 17:25:13,牛韶源,sy_niu_tongji@tongji.edu.cn,niuniuniu
1 木木FT 2022/4/24 22:53:54 木木FT 317227619@qq.com 木木
2 HL 2022/4/24 22:54:19 李辉 1652286@tongji.edu.cn 李辉
3 对方正在输入... 2022/4/24 22:54:25 您真牛啊 lin1795829528@vip.qq.com 您真牛啊
4 2022/4/24 22:54:41 yan 851584208@qq.com yan
5 luwen 2022/4/24 22:54:53 luwen shanjubiji@126.com luwen
6 张余歌 2022/4/24 22:55:57 张余歌 1227680236@qq.com 24ukong
7 Shmily 2022/4/24 22:57:37 Shmily wentaogao@tongji.edu.cn wentaogao
8 鹿衔 2022/4/24 22:58:02 鹿衔 617909747@qq.com 一芝小脑斧
9 Nebula 2022/4/24 22:58:52 Nebula 1246767047@qq.com Nebula
10 星野爱学习 2022/4/24 22:59:04 星野爱学习 3417319963@qq.com 洛武司靼敌
11 瓜洲渡 2022/4/24 23:12:35 瓜洲渡 906207351@qq.com 瓜洲渡
12 朽油盖 2022/4/24 23:13:26 浊酒 2278207907@qq.com 浊酒
13 2022/4/24 23:15:20 666@qq.com qi
14 sc🐟 2022/4/24 23:31:21 sc🐟 2605166556@qq.com raganoros
15 Alley 2022/4/25 7:18:06 虫二 3569612650@qq.com 李哈哈
16 白驹 2022/4/25 9:36:45 白驹 1900036514@qq.com 陈晓宇
17 角落 2022/4/25 9:43:39 角落 1628966701@qq.com Kirsi
18 朱sir. 2022/4/25 14:21:17 朱sir. 3327078581@qq.com 雷神的小锤子
19 牛韶源 2022/4/25 17:25:13 牛韶源 sy_niu_tongji@tongji.edu.cn niuniuniu