def chooseAction(self, gameState):
     if self.defenseMode:
         pathToSpot = self.aStarSearch(
             gameState.getAgentPosition(self.index), gameState,
             [self.GoToSpot]) or [Directions.STOP]
         return pathToSpot[0]
     else:
         return CaptureAgent.chooseAction(self, gameState)