@jit(nopython=True)
def sa_indices(num_states, num_actions):
 L = (num_states * num_actions)
 dtype = np.int_
 s_indices = np.empty(L, dtype=dtype)
 a_indices = np.empty(L, dtype=dtype)
 i = 0
 for s in range(num_states):
  for a in range(num_actions):
   s_indices[i] = s
   a_indices[i] = a
   i += 1
 return (s_indices, a_indices)

@ jit ( nopython = True ) def sa_indices ( num_states , num_actions ) : L = ( num_states * num_actions ) dtype = np . int_ s_indices = np . empty ( L , dtype = dtype ) a_indices = np . empty ( L , dtype = dtype ) i = 0 for s in range ( num_states ) : for a in range ( num_actions ) : s_indices [ i ] = s a_indices [ i ] = a i += 1 return ( s_indices , a_indices )
generate s_indices and a_indices for discretedp .