RLPack
 
Loading...
Searching...
No Matches
C_Memory::C_MemoryData Struct Reference

The class C_MemoryData keeps the references to data that is associated with C_Memory. This class implements the functions necessary to retrieve the data by de-referencing the data associated with C_Memory. More...

Public Member Functions

 C_MemoryData ()
 
std::map< std::string, std::deque< float_t > > dereference_priorities () const
 
std::map< std::string, std::deque< int64_t > > dereference_terminal_state_indices () const
 
std::map< std::string, std::deque< torch::Tensor > > dereference_transition_information ()
 
void set_priorities_reference (std::deque< float_t > *&prioritiesFloatReference)
 
void set_terminal_state_indices_reference (std::deque< int64_t > *&terminalStateIndicesReference)
 
void set_transition_information_references (std::deque< torch::Tensor > *&statesCurrent, std::deque< torch::Tensor > *&statesNext, std::deque< torch::Tensor > *&rewards, std::deque< torch::Tensor > *&actions, std::deque< torch::Tensor > *&dones, std::deque< torch::Tensor > *&priorities, std::deque< torch::Tensor > *&probabilities, std::deque< torch::Tensor > *&weights)
 
void set_transition_information_references (std::string &key, std::deque< torch::Tensor > *&reference)
 
 ~C_MemoryData ()
 

Private Attributes

std::deque< float_t > * prioritiesFloatReference_ = nullptr
 The reference to deque that stores priorities float; C_Memory::prioritiesFloat_. More...
 
std::deque< int64_t > * terminalIndicesReference_ = nullptr
 The reference to deque that stores terminal state indices; C_Memory::terminalStateIndices_. More...
 
std::map< std::string, std::deque< torch::Tensor > * > transitionInformationReference_
 

Detailed Description

The class C_MemoryData keeps the references to data that is associated with C_Memory. This class implements the functions necessary to retrieve the data by de-referencing the data associated with C_Memory.

Constructor & Destructor Documentation

◆ C_MemoryData()

C_Memory::C_MemoryData::C_MemoryData ( )
default

The default constructor for C_Memory::C_MemoryData

◆ ~C_MemoryData()

C_Memory::C_MemoryData::~C_MemoryData ( )
default

The default destructor for C_Memory::C_MemoryData

Member Function Documentation

◆ dereference_priorities()

std::map< std::string, std::deque< float_t > > C_Memory::C_MemoryData::dereference_priorities ( ) const

The function to dereference the pointers from C_Memory::C_MemoryData::prioritiesFloatReference_.

Returns
The map between float priorities and the corresponding deque. Always returns the map with key priorities.

◆ dereference_terminal_state_indices()

std::map< std::string, std::deque< int64_t > > C_Memory::C_MemoryData::dereference_terminal_state_indices ( ) const

The function to dereference the pointers from C_Memory::C_MemoryData::terminalIndicesReference_.

Returns
The map between terminal state indices and the corresponding deque. Always returns the map with key terminal_state_indices.

◆ dereference_transition_information()

std::map< std::string, std::deque< torch::Tensor > > C_Memory::C_MemoryData::dereference_transition_information ( )

The function to dereference the pointers from C_Memory::C_MemoryData::transitionInformationReference_.

Returns
Map of string indicating the transition quantity name and the corresponding deque.

◆ set_priorities_reference()

void C_Memory::C_MemoryData::set_priorities_reference ( std::deque< float_t > *&  prioritiesFloatReference)

Function to set the references to C_Memory::C_MemoryData::prioritiesFloatReference_.

Parameters
prioritiesFloatReferenceThe reference to C_Memory:prioritiesFloat_.

◆ set_terminal_state_indices_reference()

void C_Memory::C_MemoryData::set_terminal_state_indices_reference ( std::deque< int64_t > *&  terminalStateIndicesReference)

Function to set the references to C_Memory::C_MemoryData::transitionInformationReference_.

Parameters
*terminalStateIndicesReferenceThe reference to C_Memory::terminalStateIndices_.

◆ set_transition_information_references() [1/2]

void C_Memory::C_MemoryData::set_transition_information_references ( std::deque< torch::Tensor > *&  statesCurrent,
std::deque< torch::Tensor > *&  statesNext,
std::deque< torch::Tensor > *&  rewards,
std::deque< torch::Tensor > *&  actions,
std::deque< torch::Tensor > *&  dones,
std::deque< torch::Tensor > *&  priorities,
std::deque< torch::Tensor > *&  probabilities,
std::deque< torch::Tensor > *&  weights 
)

Function to set the references to C_Memory::C_MemoryData::transitionInformationReference_.

Parameters
statesCurrent: The pointer to deque of current states; C_Memory::statesCurrent_.
statesNext: The pointer to deque of next states; C_Memory::statesNext_.
rewards: The pointer to deque of rewards; C_Memory::rewards_.
actions: The pointer to deque of actions; C_Memory::actions.
dones: The pointer to deque of dones; C_Memory::dones_.
priorities: The pointer to deque of priorities; C_Memory::priorities_.
probabilities: The pointer to deque of probabilities; C_Memory::probabilities_.
weights: The pointer to deque of weights; C_Memory::weights_.

◆ set_transition_information_references() [2/2]

void C_Memory::C_MemoryData::set_transition_information_references ( std::string &  key,
std::deque< torch::Tensor > *&  reference 
)

Function to set the references to C_Memory::C_MemoryData::transitionInformationReference_ for a single key.

Parameters
key: The key on which reference is to be set.
*reference: The reference pointer.

Field Documentation

◆ prioritiesFloatReference_

std::deque<float_t>* C_Memory::C_MemoryData::prioritiesFloatReference_ = nullptr
private

The reference to deque that stores priorities float; C_Memory::prioritiesFloat_.

◆ terminalIndicesReference_

std::deque<int64_t>* C_Memory::C_MemoryData::terminalIndicesReference_ = nullptr
private

The reference to deque that stores terminal state indices; C_Memory::terminalStateIndices_.

◆ transitionInformationReference_

std::map<std::string, std::deque<torch::Tensor> *> C_Memory::C_MemoryData::transitionInformationReference_
private

The map to store references to each deque that stores each quantity from transitions. This map stores the references to following containers: