def _add(self, state, r):
if self._current_capacity >= self._capacity:
# find the LRU entry
old_index = np.argmin(self._lru) # ??????????
self._states[old_index] = state
self._q_values[old_index] = r
self._lru[old_index] = self._time
else:
self._states[self._current_capacity] = state
self._q_values[self._current_capacity] = r
self._lru[self._current_capacity] = self._time
self._current_capacity += 1
self._time += 0.01
# ????????
self._tree = KDTree(self._states[:self._current_capacity])
# TDOO: _time?????????????????
评论列表
文章目录