-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmemory_buffer.hpp
More file actions
45 lines (26 loc) · 911 Bytes
/
memory_buffer.hpp
File metadata and controls
45 lines (26 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef MEMORY_BUFFER_HPP
#define MEMORY_BUFFER_HPP
#include <iostream>
#include <eigen3/Eigen/Eigen>
class memory_buffer{
private:
std::vector<Eigen::RowVectorXf*> vObservation;
std::vector<Eigen::RowVectorXf*> vObservation1;
std::vector<float> vAction;
std::vector<bool> vDone;
std::vector<float> vReward;
public:
memory_buffer();
~memory_buffer();
void add(Eigen::RowVectorXf& obs, Eigen::RowVectorXf& obs1, float act, bool bdone, float reward);
int size();
Eigen::RowVectorXf* sample_observation(int idx);
Eigen::RowVectorXf* sample_observation1(int idx);
float sample_action(int idx);
bool sample_done(int idx);
float sample_reward(int idx);
void display_memory(int idx);
void forget_memory(int idx);
void clear_memory();
};
#endif