Implement a Q Learning algorithm for game agents.