def get_action(self, state):
     actions = state.available_moves()
     
     for a in actions:
     
         if DSL.isDoubles(a) and DSL.actionWinsColumn(state,a):
             self._counter_calls[0] += 1
             return a
                 
         if DSL.numberPositionsConquered(state,5)>0 and DSL.containsNumber(a,4):
             self._counter_calls[1] += 1
             return a
                 
         if DSL.isStopAction(a) and DSL.numberPositionsConquered(state,5)>1 and DSL.containsNumber(a,6):
             self._counter_calls[2] += 1
             return a
                 
         if DSL.isStopAction(a) and DSL.numberPositionsProgressedThisRoundColumn(state,2)>2 and DSL.isStopAction(a):
             self._counter_calls[3] += 1
             return a
                 
         if DSL.isStopAction(a):
             self._counter_calls[4] += 1
             return a
                 
         if DSL.actionWinsColumn(state,a) and DSL.actionWinsColumn(state,a):
             self._counter_calls[5] += 1
             return a
                 
         if DSL.isStopAction(a):
             self._counter_calls[6] += 1
             return a
                 
     return actions[0]
                 
예제 #2
0
    def get_action(self, state):
        actions = state.available_moves()

        for a in actions:

            if DSL.hasWonColumn(state) and DSL.isStopAction(a):
                self._counter_calls[0] += 1
                return a

            if DSL.actionWinsColumn(state, a) and DSL.hasWonColumn(state):
                self._counter_calls[1] += 1
                return a

            if DSL.numberPositionsConquered(
                    state, 5) > 2 and DSL.containsNumber(a, 4):
                self._counter_calls[2] += 1
                return a

        return actions[0]