At this point, we have defined the environment and our agent, which will make running our model quite straightforward. Remember that to get set up for reinforcement learning using R, we used a technique from object-oriented programming, which is not used very often in a programming language such as R. We created a class that describes an object, but is itself not an object. To create an object from a class, we must instantiate it. We set our initial values and instantiate an object using our DQNAgent class by using the following code:
state_size = 2 action_size = 20
agent = DQNAgent(state_size, action_size)
After running this block of code, we will see an agent object in our environment. The agent has a class of Environment; however, if we click on it, we will see something similar to the following screenshot, which contains some...