heatherhb

Untitled

Nov 18th, 2011
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       for action in gameState.getLegalActions(agentInd):
  2.         if agentInd == gameState.getNumAgents()-1: #then consider max's moves
  3.           if curDepth == self.depth: #leaf node
  4.             value = self.evaluationFunction(gameState)
  5.           else:
  6.             value = min(value, self.maxVal(gameState.generateSuccessor(agentInd, action), curDepth+1))
  7.         else: #if agentInd < gameState.getNumAgents()-1: #accumulate all ghost moves
  8.           value = min(value, self.minVal(gameState.generateSuccessor(agentInd, action), curDepth, agentInd+1))
  9.  
Advertisement
Add Comment
Please, Sign In to add comment