Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
人狼知能プロジェクト・プロトコル解説
Next
Download to read offline and view in fullscreen.

2

Share

AIWolfPy v0.4.9

Download to read offline

Pythonで人狼知能大会に参加するためのパッケージ"AIWolfPy"のドキュメントです

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

AIWolfPy v0.4.9

  1. 1. AIWolfPy v0.4.9 Kei Harada(cash)
  2. 2. Table of Contents 0. 1. Agent 2. Agent 3. 4. (python_sample) 5. 2
  3. 3. AIWolfPy aiwolf.org python http://aiwolf.org Java TCP/IP (Java ) JSON AIWolfPy 3
  4. 4. AIWolf AI 4
  5. 5. Python Google for ( 10 ) C 5
  6. 6. OK Python ./hogehoge.py Agent Agent aiwolfpy.connect_parse 6
  7. 7. Chap. 1. Agent 1. 1. 1. 2. AIWolf Server 1.3. Python Agent 7
  8. 8. 1. 1. Python python2 2.7( 2.7.12) python3 3.4 ( 3.5.2) 2.7 + numpy, spicy, pandas, scikit-learn Anaconda Java 8
  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
  10. 10. 1.3. Python Agent https://github.com/k-harada/AIWolfPy ( ver0.4.9) ./python_sample.py -h localhost -p 10000 AIWolf Server Starter Start Game Start Game python 14 Java 10
  11. 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
  12. 12. 2.1.1. Phase (0 whisper divine ) talk: turn vote: whisper: 2 talk whisper CO attack/divine/guard: 12
  13. 13. 2.1.2. aiwolfpy.connent_parse agent aiwolfpy agent (python) JSON request base_info diff_data 13
  14. 14. 2.1.3. (1) python_simple_sample ver0.4.9 parse connect_parse __init__(self) getName(self) initialize(self, base_info, diff_data, game_setting) __init__ Agent 14
  15. 15. 2.1.3. (2) update(self, base_info, diff_data, request) Java request( update ) 2 1 update+ daily_finish talk update vote request == ‘DAILY_FINISH’ update 15
  16. 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. 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. 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. 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. 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. 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
  22. 22. 2.3. (http://aiwolf.org/resource) Agent aiwolfpy.read_log(file) aiwolfpy github notebook 22
  23. 23. Chap. 3. 3.1. 3.2. 23
  24. 24. 3.1. java hoge python_simple_sample python_simple_sample.py myname = ‘cash’ myname = ‘hoge’ hoge python_simple_sample.py aiwolfpy hoge hoge.zip zip 24
  25. 25. 3.2. OK Python jar/dll/zip hoge.zip python_simple_sample.py hoge OK 25
  26. 26. Chap. 4. 4.1. aiwolfpy 4.2. sample 4.3. Tensor5460 26
  27. 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
  28. 28. 4.1. aiwolfpy (2) python_simple_sample.py python_sample.py aiwolfpy/cash Tensor5460 Predictor notebook jupyter notebook 28
  29. 29. 4.2. sampleagent 2 (6/24 ) (GAT2016 2016 2 ) AgentId python tensor5460 notebook VOTE PP 5 29
  30. 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
  31. 31. 4.3.2. Tensor5460 Agent __init__ __init__ (15*K, 15*15*L) Tensor5460.apply_tensor_df() 5460 DataFrame numpy.ndarray RNN, LSTM 31
  32. 32. 5. 2017 fix Agent java sample Agent Github(k-harada) python 32
  33. 33. JSON DataFrame Feature LOG FeatureTensor Prob 33 Strategy Action
  • TakuyaYaguchi

    Nov. 16, 2017
  • otanet

    Jul. 7, 2017

Pythonで人狼知能大会に参加するためのパッケージ"AIWolfPy"のドキュメントです

Views

Total views

2,549

On Slideshare

0

From embeds

0

Number of embeds

15

Actions

Downloads

28

Shares

0

Comments

0

Likes

2

×