@@ -47,7 +47,7 @@ void test_frozen_lake(RESTRLEnvClient& server){
4747 std::cout<<" Environment version: " <<env.version ()<<std::endl;
4848
4949 // once the env is created we can get it's id
50- std::cout<<" Environment is: " <<env.idx ()<<std::endl;
50+ std::cout<<" Environment idx is: " <<env.idx ()<<std::endl;
5151
5252 // the create flag should be true
5353 std::cout<<" Is environment created? " <<env.is_created ()<<std::endl;
@@ -107,8 +107,6 @@ void test_taxi(RESTRLEnvClient& server){
107107
108108 Taxi env (server);
109109
110- // environment name can also be accessed via env.env_name()
111- std::cout<<" Is environment registered: " <<server.is_env_registered (env.env_name ())<<std::endl;
112110 std::cout<<" Environment URL: " <<env.get_url ()<<std::endl;
113111
114112 // make the environment
@@ -121,7 +119,7 @@ void test_taxi(RESTRLEnvClient& server){
121119 std::cout<<" Environment version: " <<env.version ()<<std::endl;
122120
123121 // once the env is created we can get it's id
124- std::cout<<" Environment is: " <<env.idx ()<<std::endl;
122+ std::cout<<" Environment idx is: " <<env.idx ()<<std::endl;
125123
126124 // the create flag should be true
127125 std::cout<<" Is environment created? " <<env.is_created ()<<std::endl;
@@ -165,7 +163,6 @@ void test_taxi(RESTRLEnvClient& server){
165163
166164 // close the environment
167165 env.close ();
168-
169166}
170167
171168
@@ -207,12 +204,24 @@ void test_cliff_world(RESTRLEnvClient& server){
207204 options[" max_episode_steps" ] = std::any (static_cast <bitrl::uint_t >(10 ));
208205 std::unordered_map<std::string, std::any> reset_ops;
209206 reset_ops.insert ({" seed" , static_cast <uint_t >(42 )});
210- env.make (" v0" , options, reset_ops);
207+ env.make (" v1" , options, reset_ops);
208+
209+ // query the environemnt version
210+ std::cout<<" Environment version: " <<env.version ()<<std::endl;
211211
212- std::cout<<" Is environment created? " <<env.is_created ()<<std::endl;
213- std::cout<<" Is environment alive? " <<env.is_alive ()<<std::endl;
214- std::cout<<" Number of valid actions? " <<env.n_actions ()<<std::endl;
215- std::cout<<" Number of states? " <<env.n_states ()<<std::endl;
212+ // once the env is created we can get it's id
213+ std::cout<<" Environment idx is: " <<env.idx ()<<std::endl;
214+
215+ // the create flag should be true
216+ std::cout<<" Is environment created? " <<env.is_created ()<<std::endl;
217+
218+ // environment should be alive on the server
219+ std::cout<<" Is environment alive? " <<env.is_alive ()<<std::endl;
220+
221+ // FrozenLake is a discrete state-action env so we can
222+ // query number of actions and states
223+ std::cout<<" Number of valid actions? " <<env.n_actions ()<<std::endl;
224+ std::cout<<" Number of states? " <<env.n_states ()<<std::endl;
216225
217226 // reset the environment
218227 auto time_step = env.reset ();
@@ -265,10 +274,10 @@ int main(){
265274 example_1::test_taxi (server);
266275 std::cout<<" ====================" <<std::endl;
267276 std::cout<<" Testing BlackJack..." <<std::endl;
268- // example_1::test_black_jack(server);
277+ example_1::test_black_jack (server);
269278 std::cout<<" ====================" <<std::endl;
270279 std::cout<<" Testing CliffWorld..." <<std::endl;
271- // example_1::test_cliff_world(server);
280+ example_1::test_cliff_world (server);
272281 std::cout<<" ====================" <<std::endl;
273282 return 0 ;
274283}
0 commit comments