pantheonrl.common.wrappers.HistoryQueue

class HistoryQueue(defaultelem, size)[source]

Bases: object

Ring buffer representing the saved history for the FrameStack wrappers.

Parameters:
  • defaultelem (ndarray) – The default element for an empty buffer

  • size (int) – The length of the queue

Methods

add

Add the given value to the queue and return the new representation

reset

Reset the queue.

add(toadd)[source]

Add the given value to the queue and return the new representation

Parameters:

toadd (ndarray) – The new value to add. This overrides the oldest value

Returns:

The new queue representation, where the first element is the most recently added element and the last element is the oldest

Return type:

ndarray

reset()[source]

Reset the queue. This fills the buffer with the defaultelement.

Return type:

None