def __transitions(self):
    ' Computes the transition probabilities for every state action pair.\n            :return numpy.tensor transition probabilities: tensor of transition\n            probabilities of dimension S*S*A\n        '
    dimensions = (self.n_states, self.n_states, self.n_actions)
    transition_probabilities = np.zeros(dimensions)
    for s in range(self.n_states):
        if ((self.states[s][0], self.states[s][1]) == (self.states[s][2], self.states[s][3])):
            transition_probabilities[self.initial_state, s, :] = (1 / 3)
        else:
            for a in range(self.n_actions):
                list_pos = self.__police_positions(s)
                for police_pos in list_pos:
                    next_s = self.__move(s, a)
                    new_pos = np.copy(self.states[next_s])
                    new_pos[2:] = police_pos
                    next_s = self.map[tuple(new_pos)]
                    transition_probabilities[(next_s, s, a)] = (1 / len(list_pos))
    return transition_probabilities
Computes the transition probabilities for every state action pair.
:return numpy.tensor transition probabilities: tensor of transition
probabilities of dimension S*S*A
def __transitions(self):
    ' Computes the transition probabilities for every state action pair.\n            :return numpy.tensor transition probabilities: tensor of transition\n            probabilities of dimension S*S*A\n        '
    dimensions = (self.n_states, self.n_states, self.n_actions)
    transition_probabilities = np.zeros(dimensions)
    for s in range(self.n_states):
        if ((self.states[s][0], self.states[s][1]) == (self.states[s][2], self.states[s][3])):
            transition_probabilities[self.initial_state, s, :] = (1 / 3)
        else:
            for a in range(self.n_actions):
                list_pos = self.__police_positions(s)
                for police_pos in list_pos:
                    next_s = self.__move(s, a)
                    new_pos = np.copy(self.states[next_s])
                    new_pos[2:] = police_pos
                    next_s = self.map[tuple(new_pos)]
                    transition_probabilities[(next_s, s, a)] = (1 / len(list_pos))
    return transition_probabilities