-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame_actor_transition_buffer.h
More file actions
40 lines (32 loc) · 970 Bytes
/
Copy pathgame_actor_transition_buffer.h
File metadata and controls
40 lines (32 loc) · 970 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
#ifndef RLCC_GAME_ACTOR_TRANSITION_BUFFER_H
#define RLCC_GAME_ACTOR_TRANSITION_BUFFER_H
#include <vector>
#include "rela/tensor_dict.h"
#include "rela/transition.h"
#include "rela/types.h"
namespace rlcc {
class GameActorTransitionBuffer {
public:
GameActorTransitionBuffer(const float gamma) : gamma_(gamma) {}
void PushObsAndReply(const rela::TensorDict& obs,
const rela::TensorDict& reply) {
reply_history_.push_back(reply);
obs_history_.push_back(obs);
}
void SetTerminalAndReward(const float reward){
reward_ = reward;
}
size_t Size() const{
return obs_history_.size();
}
// rela::Transition PopTransition(){
// rela::TensorDict d = rela::tensor_dict::stack(obs_history_, 0);
// }
private:
float gamma_;
std::vector<rela::TensorDict> reply_history_;
std::vector<rela::TensorDict> obs_history_;
float reward_;
};
} // namespace rlcc
#endif /* RLCC_GAME_ACTOR_TRANSITION_BUFFER_H */