How to let the agent choose how to populate a state space matrix in RL (using python)
I think this question is hinting at the problem of choosing an exploration strategy.
The simplest strategy is to use the so called epsilon-greedy strategy (or $\epsilon$-greedy). This means that you select an action at random $x$ percent of the times that an agent has to select an action. The other times, the agent takes the action that its current policy dictates. Usually, $x$ declines throughout the learning process.
There are many different exploration strategies to choose from, with the aforementioned one being really the most simple one. For getting an impression of how diverse these different approaches to exploration strategies are, please be referred to Google Scholar (searching for &quot;reinforcement learning exploration strategies&quot;).