* Constructor of ReplayMemory. * * @param {number} maxLen Maximal buffer length.
(maxLen)
| 25 | * @param {number} maxLen Maximal buffer length. |
| 26 | */ |
| 27 | constructor(maxLen) { |
| 28 | this.maxLen = maxLen; |
| 29 | this.buffer = []; |
| 30 | for (let i = 0; i < maxLen; ++i) { |
| 31 | this.buffer.push(null); |
| 32 | } |
| 33 | this.index = 0; |
| 34 | this.length = 0; |
| 35 | |
| 36 | this.bufferIndices_ = []; |
| 37 | for (let i = 0; i < maxLen; ++i) { |
| 38 | this.bufferIndices_.push(i); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Append an item to the replay buffer. |
nothing calls this directly
no outgoing calls
no test coverage detected