This implementation is highly inspired by the Q-learning implementation from a book, written by Patrick R. Nicolas, Scala for Machine Learning - Second Edition, Packt Publishing Ltd., September 2017. Thanks to the author and Packt Publishing Ltd. The source code is available at https://github.com/PacktPublishing/Scala-for-Machine-Learning-Second-Edition/tree/master/src/main/scala/org/scalaml/reinforcement.
Interested readers can take a look at the the original implementation at the extensed version of course can be downloaded from Packt repository or GitHub repo of this book. The key components of implementation of the Q-learning algorithm are a few classes—QLearning, QLSpace, QLConfig, QLAction, QLState ...