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