heatherhb

Untitled

Nov 18th, 2011
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. for action in gameState.getLegalActions(agentInd):
  2.        
  3.         if agentInd == gameState.getNumAgents()-1: #then consider max's moves
  4.           if curDepth == self.depth: #leaf node
  5.             return self.evaluationFunction(gameState)
  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