-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_5.cpp
67 lines (43 loc) · 1.48 KB
/
example_5.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
60
61
62
63
64
65
66
67
#include "rlenvs/envs/grid_world/grid_world_env.h"
#include "rlenvs/rlenvs_types_v2.h"
#include "rlenvs/rlenvs_consts.h"
#ifdef RLENVSCPP_DEBUG
#include <cassert>
#endif
#include <iostream>
#include <string>
#include <random>
#include <unordered_map>
namespace example_5{
using namespace rlenvscpp::envs::grid_world;
void create_static(){
std::cout<<"Creating STATIC Gridworld..."<<std::endl;
rlenvscpp::envs::grid_world::Gridworld<4> env;
std::unordered_map<std::string, std::any> options;
options["mode"] = std::any(GridWorldInitType::STATIC);
env.make("v0", options);
std::cout<<"Number of actions: "<<env.n_actions()<<std::endl;
std::cout<<"Number of states: "<<env.n_states()<<std::endl;
std::cout<<"Version: "<<env.version()<<std::endl;
std::cout<<"Name: "<<env.env_name()<<std::endl;
env.close();
}
void create_random(){
std::cout<<"Creating RANDOM Gridworld..."<<std::endl;
rlenvscpp::envs::grid_world::Gridworld<4> env;
std::unordered_map<std::string, std::any> options;
options["mode"] = std::any(GridWorldInitType::RANDOM);
env.make("v0", options);
std::cout<<"Number of actions: "<<env.n_actions()<<std::endl;
std::cout<<"Number of states: "<<env.n_states()<<std::endl;
std::cout<<"Version: "<<env.version()<<std::endl;
std::cout<<"Name: "<<env.env_name()<<std::endl;
env.close();
}
}
int main(){
using namespace example_5;
create_static();
create_random();
return 0;
}