Implementing the Q_Learner class's discretize method