发表在 人工智能爱好者 08-26 23:19:29
前提,你真的想进行关于人工智能的研究
其次,从此贴起,我发表的帖子理论基础来源于《人工智能:计算agent基础》一书(普尔 (David L.Poole)、 麦克沃思 (Alan K.Mackworth编写)) (其实这本书我第一章还没看完)
最重要的是 书中给的是在AIapace的教学程序,而在这本书的官网中给出了AIlog和AIpython两个编程系统
从现在开始,我粘AIpython的(代码?抱歉,我没学过python,粘代码的目的就是希望有Python的大神来帮我分析下)
这是官网对AIPython的介绍,建议用谷歌浏览器翻译,下载下来的zip百度盘链接在此 本宝宝不会用,还望大神指点 只有算法思路,不会编程...555...
根目录下 CMD
C:\Users\Administrator\Downloads\AIPython 的目录
2017/08/10 17:51 <DIR> .
2017/08/10 17:51 <DIR> ..
2017/07/24 09:53 <DIR> AIPython
2017/07/26 12:33 <DIR> __MACOSX
0 个文件 0 字节
4 个目录 72,876,929,024 可用字节
C:\Users\Administrator\Downloads\AIPython\AIPython 的目录
2017/07/24 09:53 <DIR> .
2017/07/24 09:53 <DIR> ..
2017/07/24 10:20 12,292 .DS_Store
2017/07/24 09:49 4,985 agents.aux
2017/04/11 13:08 22,082 agents.tex
2017/07/24 09:52 <DIR> aipython
2017/07/24 09:49 1,182 aipython.aux
2017/07/24 09:49 17,142 aipython.idx
2017/07/22 14:32 343 aipython.ilg
2017/07/22 14:32 15,382 aipython.ind
2017/07/24 09:49 116,799 aipython.log
2017/07/24 09:49 4,875 aipython.out
2017/07/24 09:49 1,032,078 aipython.pdf
2017/07/24 09:49 2,634,840 aipython.synctex.gz
2017/07/18 11:15 4,370 aipython.tex
2017/07/04 17:11 4,362 aipython.tex~
2017/07/24 09:49 11,961 aipython.toc
2017/07/24 09:53 1,339,910 aipython.zip
2017/07/18 09:59 <DIR> aipython_322
2017/05/29 12:39 3,565 aipython_322.tex
2017/07/12 20:02 1,033,448 aipython_old.pdf
2017/07/24 09:49 7,263 csp.aux
2017/07/18 11:12 51,669 csp.tex
2017/07/17 22:21 53,990 csp.tex~
2017/06/27 12:19 50,423 csp_orig.tex
2017/07/18 12:02 2,556 extract_code.py
2017/05/29 11:25 2,498 extract_code.py~
2016/02/03 23:08 <DIR> figures
2017/07/18 12:05 390 header.py
2016/12/21 12:44 401 header.py~
2017/07/04 17:45 15,281 index.html
2017/06/27 21:52 14,888 index.html~
2016/12/17 17:38 58 issues.txt
2017/07/24 09:49 7,032 learning.aux
2017/07/19 18:58 73,891 learning.tex
2017/07/02 10:42 73,887 learning.tex~
2017/07/24 09:49 3,081 learnUncertainty.aux
2017/07/02 10:40 17,008 learnUncertainty.tex
2017/07/02 10:10 16,938 learnUncertainty.tex~
2015/10/29 16:36 2,719 logic.py
2015/10/29 14:25 1,750 logic.py~
2017/07/24 09:49 3,498 mas.aux
2016/03/11 18:27 10,320 mas.tex
2015/11/17 21:58 9,712 mas.tex~
2016/03/11 09:38 1,857 notes.txt
2015/11/15 12:52 1,114 notes.txt~
2017/07/24 09:49 5,725 planning.aux
2017/07/18 12:17 42,992 planning.tex
2017/07/02 10:38 42,993 planning.tex~
2017/07/24 09:49 4,229 planUncertainty.aux
2015/12/01 11:29 1,360 planUncertainty.rel
2017/07/02 10:33 15,788 planUncertainty.tex
2016/03/16 23:04 15,628 planUncertainty.tex~
2017/07/24 09:49 3,617 propositions.aux
2017/07/18 13:04 16,398 propositions.tex
2016/12/22 21:06 16,215 propositions.tex~
2017/07/24 09:49 4,880 python.aux
2016/02/17 15:23 4,207 python.rel
2016/02/17 15:23 383 python.rip
2017/07/20 12:21 21,142 python.tex
2017/07/06 16:14 20,864 python.tex~
2017/05/29 11:25 1,659 readme.txt
2017/07/24 09:49 3,115 relational.aux
2017/07/02 10:13 13,656 relational.tex
2017/06/01 10:33 13,620 relational.tex~
2017/07/24 09:49 5,832 rl.aux
2017/07/02 10:52 34,647 rl.tex
2017/04/07 09:35 34,362 rl.tex~
2017/07/24 09:49 5,283 search.aux
2017/07/24 09:49 36,264 search.tex
2017/07/20 22:35 39,850 search.tex~
2017/07/21 09:14 39,934 search_with_complicated_dfs.tex
2017/07/24 09:49 8,955 uncertainty.aux
2017/07/02 10:59 65,479 uncertainty.tex
2016/10/25 16:51 65,483 uncertainty.tex~
70 个文件 7,266,400 字节
5 个目录 73,049,550,848 可用字节
先发header.py
# AIFCA Python3 code Version 0.7.1 Documentation at http://aipython.org
# Artificial Intelligence: Foundations of Computational Agents
# http://artint.info
# Copyright David L Poole and Alan K Mackworth 2017.
# This work is licensed under a Creative Commons
# Attribution-NonCommercial-ShareAlike 4.0 International License.
# See: http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en再发extract_code.py
# Extracts code from the latex documents.
# Python 3 code. Full documentation at http://artint.info/code/python/aipython.pdf
# Artificial Intelligence: Foundations of Computational Agents
# http://artint.info
# Copyright David L Poole and Alan K Mackworth 2016.
# This work is licensed under a Creative Commons
# Attribution-NonCommercial-ShareAlike 4.0 International License.
# See: http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en_US.
import re
all_files = ['python.tex', 'agents.tex', 'search.tex', 'csp.tex', 'propositions.tex',
'planning.tex', 'learning.tex', 'uncertainty.tex', 'planUncertainty.tex',
'learnUncertainty.tex', 'mas.tex', 'rl.tex', 'relational.tex']
base_folder = 'aipython/'
base_folder_alt = 'aipython_322/'
## some_files = ['python.tex', 'search.tex','csp.tex']
##base_folder_alt = 'aifca_new/'
some_files = ['python.tex', 'search.tex','csp.tex', 'propositions.tex', 'planning.tex', 'uncertainty.tex', 'planUncertainty.tex']
header = 'header.py'
def extract_code(files,base_folder):
output_files = {} # name:file dictionary
headerfile = open(header,'r')
headertext = headerfile.readlines()
headerfile.close()
for file_name in files:
file = open(file_name,'r')
output = None
for line in file:
#print(line,end="")
if output:
if line.startswith("\\end{python"):
print("found",line,end="")
output = None
else:
output.write(line)
elif line.startswith("\\begin{python}"):
print("found",line,end="")
py,name,desc = re.findall('\{[^\}]*\}',line)
name = name[1:-1]
if name in output_files:
print("Warning overwriting file",name,"-",desc[1:-1])
output = open(base_folder+name+'.py','w')
output_files[name] = output
output.write("# "+name+".py - "+desc[1:-1]+"\n")
for headl in headertext:
output.write(headl)
elif line.startswith("\\begin{pythoncont}"):
print("found",line,end="")
py,name= re.findall('\{[^\}]*\}',line)
name = name[1:-1]
output = output_files[name]
file.close()
for f in output_files.values():
f.close()
extract_code(all_files,base_folder)
extract_code(some_files,base_folder_alt)
quit()
'python.tex', 'agents.tex', 'search.tex', 'csp.tex', 'propositions.tex', 'planning.tex', 'learning.tex', 'uncertainty.tex', 'planUncertainty.tex', 'learnUncertainty.tex', 'mas.tex', 'rl.tex', 'relational.tex'这些我慢慢发,勿急