simple function to sample action from mdp