dataClassifier.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:AI-PacMan-Projects 作者: deepeshmittal 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号