SHOW:
|
|
- or go back to the newest paste.
| 1 | - | for action in gameState.getLegalActions(agentInd): |
| 1 | + | for action in gameState.getLegalActions(agentInd): |
| 2 | - | |
| 2 | + | |
| 3 | if curDepth == self.depth: #leaf node | |
| 4 | value = self.evaluationFunction(gameState) | |
| 5 | - | return self.evaluationFunction(gameState) |
| 5 | + | else: |
| 6 | - | value = min(value, self.maxVal(gameState.generateSuccessor(agentInd, action), curDepth+1)) |
| 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 |