'Compute the v-greedy policy.
Parameters
v : array_like(float, ndim=1)
Value function vector, of length n.
sigma : ndarray(int, ndim=1), optional(default=None)
Optional output array for `sigma`.
Returns
sigma : ndarray(int, ndim=1)
v-greedy policy vector, of length n.'

def compute_greedy(self, v, sigma=None):

    if (sigma is None):
        sigma = np.empty(self.num_states, dtype=int)
    self.bellman_operator(v, sigma=sigma)
    return sigma
