Public Member Functions | Private Attributes | List of all members
ergodic_exploration::ReplayBuffer Class Reference

Store and smaple past states. More...

#include <buffer.hpp>

Public Member Functions

void append (const vec &x)
 Add current state to memory. More...
 
 ReplayBuffer (unsigned int buffer_size, unsigned int batch_size)
 Constructor. More...
 
mat sampleMemory (const mat &xt) const
 Sample states from memory. More...
 

Private Attributes

unsigned int batch_size_
 
unsigned int buffer_size_
 
std::unordered_map< unsigned int, vec > memory_
 

Detailed Description

Store and smaple past states.

Definition at line 50 of file buffer.hpp.

Constructor & Destructor Documentation

◆ ReplayBuffer()

ergodic_exploration::ReplayBuffer::ReplayBuffer ( unsigned int  buffer_size,
unsigned int  batch_size 
)

Constructor.

Parameters
buffer_size- max number of states stored
batch_size- number of states randomly sampled from memory

Definition at line 49 of file buffer.cpp.

Member Function Documentation

◆ append()

void ergodic_exploration::ReplayBuffer::append ( const vec &  x)

Add current state to memory.

Parameters
x- current state

Definition at line 54 of file buffer.cpp.

◆ sampleMemory()

mat ergodic_exploration::ReplayBuffer::sampleMemory ( const mat &  xt) const

Sample states from memory.

Parameters
xt- predicted trajectory
Returns
predicted trajectory + sampled states

Definition at line 64 of file buffer.cpp.

Member Data Documentation

◆ batch_size_

unsigned int ergodic_exploration::ReplayBuffer::batch_size_
private

Definition at line 75 of file buffer.hpp.

◆ buffer_size_

unsigned int ergodic_exploration::ReplayBuffer::buffer_size_
private

Definition at line 74 of file buffer.hpp.

◆ memory_

std::unordered_map<unsigned int, vec> ergodic_exploration::ReplayBuffer::memory_
private

Definition at line 76 of file buffer.hpp.


The documentation for this class was generated from the following files:


ergodic_exploration
Author(s): bostoncleek
autogenerated on Wed Mar 2 2022 00:17:13