예제 #1
0
    def chooseAction(self, gameState):

        # First of all, we update the real distances
        updateDistances(gameState)

        move = KeyboardAgent.getAction(self, gameState)
        printFile(move, gameState, 'training_keyboardAgent.txt')

        global lastMove
        lastMove = move
        return move
예제 #2
0
  def getAction( self, state):
    action = KeyboardAgent.getAction(self, state);
    # First time through, initialize the filter
    if self.initialized == False:
        self.initFilter(state)
        self.initialized = True

    # On all movement, step the filter and take an observation
    if action != Directions.STOP:
        print state.getLegalActions(self.index)
        print state.getPacmanPosition()
        self.moveStep()
        self.observeAndResample(state)
        self.computeWeightedMeanPosition()
    return action
예제 #3
0
    def chooseAction(self, gameState):

        # First of all, we update the real distances
        updateDistances(gameState)

        t0 = time.clock()

        move = KeyboardAgent.getAction(self, gameState)

        t1 = time.clock() - t0

        livingGhostsAndPacman = gameState.getLivingGhosts()
        printStatistics(livingGhostsAndPacman, t1, 'statistics_keyboard.txt')
        printFile(move, gameState, 'training_keyboard.arff', None)

        global lastMove
        global travelledDistance
        lastMove = move
        travelledDistance += 1
        return move
 def chooseAction(self, gameState):
   return KeyboardAgent.getAction(self, gameState)
예제 #5
0
 def chooseAction(self, gameState):
     action = KeyboardAgent.getAction(self, gameState)
     self.prevAction = action
     return action
예제 #6
0
 def chooseAction(self, gameState):
     return KeyboardAgent.getAction(self, gameState)
예제 #7
0
 def chooseAction(self, gameState):
     action = KeyboardAgent.getAction(self, gameState)
     self.prevAction = action
     return action
 def chooseAction(self, gameState):
     move = KeyboardAgent.getAction(self, gameState)
     self.f.write(BustersAgent.printLineData(self, gameState, move))
     return move