States and actions in QLearning

The QLAction class specifies the transition from one state to another state. It takes two parameters—that is, from and to. Both of them have their own integer identifiers that need to be greater than 0:

  • from: A source of the action
  • to: Target of the action

The signature is given as follows:

case class QLAction(from: Int, to: Int) {    require(from >= 0, s"QLAction found from:     $from required: >=0")require(to >= 0, s"QLAction found to:     $to required: >=0")override def toString: String = s"n    Action: state     $from => state $to"}

The QLState class defines the state in the Q-learning. It takes three parameters:

  • id: An identifier that uniquely identifies a state
  • actions: A list of actions for the transition from this ...

Get Scala Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.