Contenu connexe
Similaire à AIWolfPy v0.4.9 (20)
AIWolfPy v0.4.9
- 9. 1.2. AIWolf Server
http://aiwolf.org/server ( AIWolf-
ver0.4.9)
StartServer.sh, StartGUIClient.sh (Windows
bat )
StartServer.sh , Connect
StartGUIClient.sh
JarFiles aiwolf-client.jar ( Open File
)
SampleRoleAssignPlayer Connect Agent(15
14 )
9
- 11. Chap. 2. Agent
2.1. method
2.1.1.
2.1.2.
2.1.3.
2.2.
2.2.1. base_info
2.2.2. diff_data
2.3.
11
- 16. 2.1.3. (3)
dayStart(self) : return None
update
talk(self), whisper(self) : return (text)
vote(self), attack(self), divine(self), guard(self) : return (AgentIdx)
AgentIdx 0 1
finish(self) : return None
2
16
- 17. 2.2.1. base_info
dictionary
“agentIdx”: agent ID 100
“myRole”:
“roleMap”: dictionary
“statusMap”: Agent dictionary
“remainTalkMap”: Agent dictionary
“remainWhisperMap”: Agent whisper
{'statusMap': {'3': 'DEAD', '15': 'ALIVE', '1': 'DEAD', '5':
'DEAD', '7': 'DEAD', '12': 'ALIVE', '14': 'DEAD', '2': 'DEAD',
'11': 'ALIVE', '9': 'ALIVE', '10': 'DEAD', '8': 'DEAD', '4':
'DEAD', '6': 'DEAD', '13': 'ALIVE'}, 'remainWhisperMap': {},
'day': 8, 'myRole': 'VILLAGER', 'roleMap': {'15': 'VILLAGER'},
'remainTalkMap': {'9': 10, '13': 10, '15': 10, '11': 10, '12':
10}, 'agentIdx': 15}
17
- 18. 2.2.2. diff_data(1)
pandas DataFrame
6 [“day”, “type”, “idx”, “turn”, “agent”, “text”]
“type”
“initialize”, “finish”
“talk”, “whisper”
“vote”, “attack_vote”
“execute”,“dead”
“attack”, “divine”, “identify”, “guard”
agent day idx text turn type
0 15 6 5 VOTE Agent[15] 0 vote
1 10 6 6 VOTE Agent[10] 0 vote
2 10 6 7 VOTE Agent[10] 0 vote
3 10 6 9 VOTE Agent[10] 0 vote
4 9 6 10 VOTE Agent[09] 0 vote
5 15 6 11 VOTE Agent[15] 0 vote
6 10 6 12 VOTE Agent[10] 0 vote
7 11 6 13 VOTE Agent[11] 0 vote
8 13 6 15 VOTE Agent[13] 0 vote
9 10 6 0 Over 0 execute
10 5 7 0 Over 0 dead
18
- 19. 2.2.2. diff_data(2)
type = “initialize”, “finish”
agent = idx = agentIdx
initialize day = 0
turn = 0
text = comingout ( COMINGOUT Agent[01] SEER)
type = “talk”, “whisper”
agent =
day = day, idx = talk/whisper id, turn = talk/whisper turn
text =
agent day idx text turn type
0 3 10 3 COMINGOUT Agent[03] SEER 0 finish
1 15 10 15 COMINGOUT Agent[15] VILLAGER 0 finish
2 1 10 1 COMINGOUT Agent[01] BODYGUARD 0 finish
3 5 10 5 COMINGOUT Agent[05] VILLAGER 0 finish
4 7 10 7 COMINGOUT Agent[07] VILLAGER 0 finish
5 12 10 12 COMINGOUT Agent[12] VILLAGER 0 finish
6 14 10 14 COMINGOUT Agent[14] VILLAGER 0 finish
7 2 10 2 COMINGOUT Agent[02] MEDIUM 0 finish
8 11 10 11 COMINGOUT Agent[11] VILLAGER 0 finish
9 9 10 9 COMINGOUT Agent[09] WEREWOLF 0 finish
10 10 10 10 COMINGOUT Agent[10] VILLAGER 0 finish
11 8 10 8 COMINGOUT Agent[08] WEREWOLF 0 finish
12 4 10 4 COMINGOUT Agent[04] WEREWOLF 0 finish
13 6 10 6 COMINGOUT Agent[06] POSSESSED 0 finish
14 13 10 13 COMINGOUT Agent[13] VILLAGER 0 finish
agent day idx text turn type
0 15 8 10 Over 2 talk
1 9 8 11 Skip 2 talk
2 11 8 12 Skip 2 talk
3 13 8 13 Skip 2 talk
4 12 8 14 Skip 2 talk
19
- 20. 2.2.2. diff_data(3)
type = “vote”, “attack_vote”
agent = , idx =
turn 0, 1 turn -1
text = vote attack
type = “execute”( ), “dead”( )
agent =
idx = 0, turn = 0
text = Over
agent day idx text turn type
0 15 6 5 VOTE Agent[15] 0 vote
1 10 6 6 VOTE Agent[10] 0 vote
2 10 6 7 VOTE Agent[10] 0 vote
3 10 6 9 VOTE Agent[10] 0 vote
4 9 6 10 VOTE Agent[09] 0 vote
5 15 6 11 VOTE Agent[15] 0 vote
6 10 6 12 VOTE Agent[10] 0 vote
7 11 6 13 VOTE Agent[11] 0 vote
8 13 6 15 VOTE Agent[13] 0 vote
9 10 6 0 Over 0 execute
10 5 7 0 Over 0 dead
20
- 21. 2.2.2. diff_data(4)
type = “divine”, “identify”, “guard”( guard )
agent = , idx =
turn = 0
text = DIVINED / IDENTIFIED / GUARDED
agent 1 agent 2
agent = 2, idx = 1, text = DIVINED Agent[02] WEREWOLF
type = “attack”( )
agent =
idx = 0, turn = 0
text = ATTACK
21
- 27. 4.1. aiwolfpy (1)
simple_sample
__init__.py :
tcpipclient.py : tcp/ip json
tcpipclient_parsed.py : tcp/ip +DataFrame
templatetalkfactory.py / templatewhisperfactory.py /contentbuilder.py :
(contentbuilder.py )
gameinfoparser.py : pandas.DataFrame
read_log.py:
pandas.DataFrame
27
- 30. 4.3.1. Tensor5460
15 3 1 5460
(15*K, 15*15*L) 5460
Agent1, 2 CO 5460 2CO
Tensor5460 15 CO (15 )
3 CO (5460*3) K 15*K
5460*3*K
Agent1 Agent2 Agent1 Agent2
15*15 3*3
(5460*3*3) 15*15*L 5460*3*3*L
30