def getFeatures(self,state,action):
feats = util.Counter()
handcard = list(state)
handcard.remove(action)
handSet = set(handcard)
feats['???'] = len(handcard)
feats['?'] = len([ card for card in handSet if handcard.count(card) == 2])
feats['?'] = len([ card for card in handSet if handcard.count(card) == 3])
feats['?'] = len([ card for card in handSet if handcard.count(card) == 4])
for card in handSet :
if int(card/10) < 3 and card % 10 != 0:
if card %10 < 8 and (card+1 in handSet) and (card+2 in handSet):
feats['?'] += 1
return feats
learningAgent.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录