91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

人工智能伯克利大學(xué)經(jīng)典作業(yè)pacman吃豆人python源代碼

資源截圖

代碼片段和文件信息

#?api.py
#?parsons/07-oct-2017
#
#?Version?1.1
#
#?An?API?for?use?with?the?PacMan?AI?projects?from:
#
#?http://ai.berkeley.edu/
#
#?This?provides?a?simple?way?of?controlling?the?way?that?Pacman?moves
#?and?senses?its?world?to?permit?exercises?with?limited?sensing
#?ability?and?nondeterminism?in?sensing?and?action.
#
#?As?required?by?the?licensing?agreement?for?the?PacMan?AI?we?have:
#
#?Licensing?Information:??You?are?free?to?use?or?extend?these?projects?for
#?educational?purposes?provided?that?(1)?you?do?not?distribute?or?publish
#?solutions?(2)?you?retain?this?notice?and?(3)?you?provide?clear
#?attribution?to?UC?Berkeley?including?a?link?to?http://ai.berkeley.edu.
#?
#?Attribution?Information:?The?Pacman?AI?projects?were?developed?at?UC?Berkeley.
#?The?core?projects?and?autograders?were?primarily?created?by?John?DeNero
#?(denero@cs.berkeley.edu)?and?Dan?Klein?(klein@cs.berkeley.edu).
#?Student?side?autograding?was?added?by?Brad?Miller?Nick?Hay?and
#?Pieter?Abbeel?(pabbeel@cs.berkeley.edu).

#?The?code?here?was?written?by?Simon?Parsons?based?on?examples?from
#?the?PacMan?AI?projects.

#?Sensing

def?whereAmI(state):
????#?Retunrs?an?(x?y)?pair?of?Pacman‘s?position.
????#
????#?This?version?says?exactly?where?Pacman?is.
????#?In?later?version?this?may?be?obfusticated.

????return?state.getPacmanPosition()

def?legalActions(state):
????#?Returns?the?legal?set?of?actions
????#
????#?Just?pulls?this?data?out?of?the?state.?Functin?included?so?that
????#?all?interactions?are?through?this?API.
????
????return?state.getLegalPacmanActions()

def?ghosts(state):
????#?Returns?a?list?of?(x?y)?pairs?of?ghost?positions.
????#
????#?This?version?just?returns?the?ghost?positions?from?the?state?data
????#?In?later?versions?this?will?be?more?restricted?and?include?some
????#?uncertainty.

????return?state.getGhostPositions()

def?capsules(state):
????#?Returns?a?list?of?(x?y)?pairs?of?capsule?positions.
????#
????#?This?version?just?returns?the?capsule?positions?from?the?state?data
????#?In?later?versions?this?will?be?more?restricted?and?include?some
????#?uncertainty.

????return?state.getCapsules()

def?food(state):
????#?Returns?a?list?of?(x?y)?pairs?of?food?positions
????#
????#?This?version?just?returns?all?the?current?food?locations
????#?extracted?from?the?state?data.??In?later?versions?this?will?be
????#?restricted?by?distance?and?include?some?uncertainty.
????
????foodList=?[]
????foodGrid?=?state.getFood()
????width?=?foodGrid.width
????height?=?foodGrid.height
????for?i?in?range(width):
????????for?j?in?range(height):
????????????if?foodGrid[i][j]?==?True:
????????????????foodList.append((i?j))????????????
????return?foodList

def?walls(state):
????#?Returns?a?list?of?(x?y)?pairs?of?wall?positions
????#
????#?This?version?just?returns?all?the?current?wall?locations
????#?extracted?from?the?state?data.??In?later?versions?this?will?be
????#?restricted?by?distance?and?include?some?uncertainty.
????
????wallList=?[]
????wallGrid?=?state.

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-10-18?20:00??pacman\
?????文件???????26331??2017-09-28?21:28??pacman\pacman.py
?????目錄???????????0??2018-10-19?21:39??__MACOSX\
?????目錄???????????0??2018-10-19?21:39??__MACOSX\pacman\
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\._pacman.py
?????文件????????2116??2017-09-28?21:28??pacman\pacmanAgents.py
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\._pacmanAgents.py
?????文件???????24313??2018-10-18?19:34??pacman\game.pyc
?????文件???????28031??2017-09-28?21:28??pacman\graphicsDisplay.py
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\._graphicsDisplay.py
?????文件???????10572??2017-09-28?21:28??pacman\grading.py
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\._grading.py
?????文件????????4739??2018-10-18?19:43??pacman\sampleAgents.py
?????文件????????3511??2018-10-18?19:34??pacman\ghostAgents.pyc
?????文件???????26645??2017-09-28?21:28??pacman\util.py
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\._util.py
?????文件???????25518??2017-09-28?21:28??pacman\game.py
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\._game.py
?????目錄???????????0??2017-09-28?21:28??pacman\test_cases\
?????文件??????????32??2017-09-28?21:28??pacman\test_cases\CONFIG
?????目錄???????????0??2018-10-19?21:39??__MACOSX\pacman\test_cases\
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\test_cases\._CONFIG
?????目錄???????????0??2017-09-28?21:28??pacman\test_cases\q8\
?????文件?????????103??2017-09-28?21:28??pacman\test_cases\q8\closest_dot_3.test
?????目錄???????????0??2018-10-19?21:39??__MACOSX\pacman\test_cases\q8\
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\test_cases\q8\._closest_dot_3.test
?????文件??????????87??2017-09-28?21:28??pacman\test_cases\q8\closest_dot_5.solution
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\test_cases\q8\._closest_dot_5.solution
?????文件??????????87??2017-09-28?21:28??pacman\test_cases\q8\closest_dot_4.solution
?????文件?????????212??2017-09-28?21:28??__MACOSX\pacman\test_cases\q8\._closest_dot_4.solution
?????文件?????????160??2017-09-28?21:28??pacman\test_cases\q8\closest_dot_11.test
............此處省略400個文件信息

評論

共有 條評論