def insert(self, exp_dict):
        """
        Adds experience to the replay buffer as usual, but also
        intiialize the priority of the new experience.
        """
        with self.insert_time.time():
            if self._next_idx >= len(self._memory):
                self._memory.append(exp_dict)
            else:
                self._memory[self._next_idx] = exp_dict
            self._next_idx = (self._next_idx + 1) % self.memory_size

            idx = self._next_idx
            self._it_sum[idx] = self._max_priority ** self._alpha
            self._it_min[idx] = self._max_priority ** self._alpha

        Adds experience to the replay buffer as usual, but also
        intiialize the priority of the new experience.
        
surreal/replay/prioritized_replay.py