public class LruReplayBuffer extends java.lang.Object implements ReplayBuffer
ReplayBuffer
that randomly selects across the whole buffer, but always removes
the oldest items in the buffer once it is full.Constructor and Description |
---|
LruReplayBuffer(int batchSize,
int bufferSize)
Constructs a
LruReplayBuffer . |
Modifier and Type | Method and Description |
---|---|
void |
addStep(RlEnv.Step step)
Adds a new step to the buffer.
|
RlEnv.Step[] |
getBatch()
Returns a batch of steps from this buffer.
|
public LruReplayBuffer(int batchSize, int bufferSize)
LruReplayBuffer
.batchSize
- the number of steps to train on per batchbufferSize
- the number of steps to hold in the bufferpublic RlEnv.Step[] getBatch()
getBatch
in interface ReplayBuffer
public void addStep(RlEnv.Step step)
addStep
in interface ReplayBuffer
step
- the step to add