def __rewards(self):
    rewards = np.zeros((self.n_states, self.n_actions))
    for s in range(self.n_states):
        list_pos = self.__police_positions(s)
        for a in range(self.n_actions):
            next_s = self.__move(s, a)
            if (tuple(self.states[next_s][0:2]) in list_pos):
                if (self.town_map[tuple(self.states[next_s][0:2])] != 1):
                    rewards[(s, a)] = (self.CAUGHT_REWARD / len(list_pos))
                if (self.town_map[tuple(self.states[next_s][0:2])] == 1):
                    rewards[(s, a)] = ((self.CAUGHT_REWARD / len(list_pos)) + (((len(list_pos) - 1) * self.BANK_REWARD) / len(list_pos)))
            elif (self.town_map[tuple(self.states[next_s][0:2])] == 1):
                rewards[(s, a)] = self.BANK_REWARD
    return rewards
def __rewards(self):
    rewards = np.zeros((self.n_states, self.n_actions))
    for s in range(self.n_states):
        list_pos = self.__police_positions(s)
        for a in range(self.n_actions):
            next_s = self.__move(s, a)
            if (tuple(self.states[next_s][0:2]) in list_pos):
                if (self.town_map[tuple(self.states[next_s][0:2])] != 1):
                    rewards[(s, a)] = (self.CAUGHT_REWARD / len(list_pos))
                if (self.town_map[tuple(self.states[next_s][0:2])] == 1):
                    rewards[(s, a)] = ((self.CAUGHT_REWARD / len(list_pos)) + (((len(list_pos) - 1) * self.BANK_REWARD) / len(list_pos)))
            elif (self.town_map[tuple(self.states[next_s][0:2])] == 1):
                rewards[(s, a)] = self.BANK_REWARD
    return rewards