def step(self, action, reward, next_state, done):
    self.memory.add(self.last_state, action, reward, next_state, done)
    self.reward_total += reward
    self.count += 1
    if done:
        self.score = ((self.reward_total / self.count) if (self.count > 0) else 0)
        self.score_best = max(self.best_reward, self.reward_total)
    if (len(self.memory) > self.batch_size):
        experiences = self.memory.sample()
        self.learn(experiences)
    self.last_state = next_state
def step(self, action, reward, next_state, done):
    self.memory.add(self.last_state, action, reward, next_state, done)
    self.reward_total += reward
    self.count += 1
    if done:
        self.score = ((self.reward_total / self.count) if (self.count > 0) else 0)
        self.score_best = max(self.best_reward, self.reward_total)
    if (len(self.memory) > self.batch_size):
        experiences = self.memory.sample()
        self.learn(experiences)
    self.last_state = next_state