-
Notifications
You must be signed in to change notification settings - Fork 0
/
Environment.hpp
47 lines (41 loc) · 1.2 KB
/
Environment.hpp
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
#ifndef ENVIRONMENT_CLASS
#define ENVIRONMENT_CLASS
#include <vector>
#include <iostream>
/**
* The defines the mapping between actions to numerical values
**/
#define UP 0
#define DOWN 1
#define LEFT 2
#define RIGHT 3
/**
* Enviroment class representing the attributes of the game played
**/
class Environment{
private:
/**
* p1: Probability of transitioning to the next state
* p2: Probability of staying in the current state
* discount: Discount rate (value of future rewards)
* actions: All actions available
* action_rewards: Reward for each action
**/
double p1, p2, discount;
std::vector<int> actions;
std::vector<double> action_rewards;
public:
/**
* Environment Constructor
**/
Environment(double p1, double p2, double rup, double rdown, double rleft, double rright, double discount = 0.95);
/**
* Getters
**/
std::vector<int> get_actions();
std::vector<double> get_action_rewards();
double get_discount();
double get_p1();
double get_p2();
};
#endif