def basicFeatureExtractorPacman(state):
"""
A basic feature extraction function.
You should return a util.Counter() of features
for each (state, action) pair along with a list of the legal actions
##
"""
features = util.Counter()
for action in state.getLegalActions():
successor = state.generateSuccessor(0, action)
foodCount = successor.getFood().count()
featureCounter = util.Counter()
featureCounter['foodCount'] = foodCount
features[action] = featureCounter
return features, state.getLegalActions()
dataClassifier.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录