'populate a transition by epsilon-greedy'

def _populate_exp(self):

    old_s = self.player.current_state()
    if ((self.rng.rand() <= self.exploration) or (len(self.mem) <= self.history_len)):
        act = self.rng.choice(range(self.num_actions))
    else:
        history = self.mem.recent_state()
        history.append(old_s)
        history = np.stack(history, axis=2)
        q_values = self.predictor([[history]])[0][0]
        act = np.argmax(q_values)
    (reward, isOver) = self.player.action(act)
    self.mem.append(Experience(old_s, act, reward, isOver))
