-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstate.cpp
59 lines (57 loc) · 1.43 KB
/
state.cpp
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <vector>
#include <map>
#include "state.h"
state::state(std::vector<char> actions, std::map<int, int> reward, int value, int state_number, float discount, float probability){
this->actions=actions;
this->reward=reward;
this->value=value;
this->state_number=state_number;
this->discount=discount;
this->probability=probability;
}
state::state(){}
state::~state(){}
void state::set_value(float value){
this->value=value;
}
void state::set_state_number(int state_number){
this->state_number=state_number;
}
void state::set_discount(float discount){
this->discount=discount;
}
void state::set_probability(float probability){
this->probability=probability;
}
float state::get_discount(){
return this->discount;
}
float state::get_probability(){
return this->probability;
}
std::map<int, int> state::get_reward(){
return this->reward;
}
int state::get_state_number(){
return this->state_number;
}
float state::get_value(){
return this->value;
}
std::vector<char> state::get_action(){
return this->actions;
}
void state::to_string(){
for (size_t i = 0; i < this->actions.size(); i++) {
/* code */
std::cout << this->actions[i] << '\n';
}
for (size_t i = 0; i < this->reward.size(); i++) {
/* code */
std::cout << this->reward[i] << '\n';
}
std::cout << this->value << '\n';
std::cout << this->state_number << '\n';
std::cout << this->discount << '\n';
std::cout << this->probability << '\n';
}