def start(self):
    'Starts agent-environment interaction.'
    self.callbacks.on_interaction_begin()
    while self.should_continue():
        self.callbacks.on_episode_begin(self.episode)
        self.env.reset()
        self.step = 0
        while (not self.env.is_terminal()):
            self.callbacks.on_step_begin(self.step)
            state = self.env.get_state()
            action = self.agent.get_action(state)
            (next_state, reward, done, info) = self.env.step(action)
            experience = Experience(state, action, reward, next_state, done)
            self.agent.update(experience)
            self.callbacks.on_step_end(self.step)
            self.step += 1
        self.callbacks.on_episode_end(self.episode, self.step)
        self.episode += 1
    self.callbacks.on_interaction_end(self.episode)
Starts agent-environment interaction.
def start(self):
    
    self.callbacks.on_interaction_begin()
    while self.should_continue():
        self.callbacks.on_episode_begin(self.episode)
        self.env.reset()
        self.step = 0
        while (not self.env.is_terminal()):
            self.callbacks.on_step_begin(self.step)
            state = self.env.get_state()
            action = self.agent.get_action(state)
            (next_state, reward, done, info) = self.env.step(action)
            experience = Experience(state, action, reward, next_state, done)
            self.agent.update(experience)
            self.callbacks.on_step_end(self.step)
            self.step += 1
        self.callbacks.on_episode_end(self.episode, self.step)
        self.episode += 1
    self.callbacks.on_interaction_end(self.episode)