Inverse reinforcement learning algorithm