bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
taxi_env.h
Go to the documentation of this file.
1#ifndef TAXI_H
2#define TAXI_H
3
4#include "bitrl/bitrl_config.h"
5#include "bitrl/bitrl_types.h"
8#include "bitrl/extern/nlohmann/json/json.hpp"
10
11#include <any>
12#include <string>
13#include <unordered_map>
14
15namespace bitrl
16{
17namespace envs::gymnasium
18{
19
23class Taxi final : public ToyTextEnvBase<TimeStep<uint_t>, 500, 6>
24{
25 public:
29 static const std::string name;
30
34 static const std::string URI;
35
40
46
50 typedef typename base_type::state_space_type state_space_type;
51
55 typedef typename base_type::action_space_type action_space_type;
56
60 typedef typename base_type::action_type action_type;
61
65 typedef typename base_type::state_type state_type;
66
70 Taxi(network::RESTRLEnvClient &api_server);
71
75 Taxi(const Taxi &other);
76
80 ~Taxi() override = default;
81
86 virtual void
87 make(const std::string &version, const std::unordered_map<std::string, std::any> & /*options*/,
88 const std::unordered_map<std::string, std::any> & /*reset_options*/) override final;
89
93 virtual time_step_type step(const action_type &action) override final;
94
95 protected:
99 virtual time_step_type
100 create_time_step_from_response_(const nlohmann::json &response) const override final;
101};
102
103} // namespace envs::gymnasium
104} // namespace bitrl
105#endif // TAXI_H
TimeStepType time_step_type
Alias for the type returned when stepping the environment.
Definition env_base.h:41
std::string version() const noexcept
Get the environment version set during make().
Definition env_base.h:142
The Taxi class.
Definition taxi_env.h:24
virtual time_step_type create_time_step_from_response_(const nlohmann::json &response) const override final
Handle the reset response from the environment server.
Definition taxi_env.cpp:26
Taxi(const Taxi &other)
copy constructor
base_type::time_step_type time_step_type
The time step type we return every time a step in the environment is performed.
Definition taxi_env.h:45
base_type::action_space_type action_space_type
The type of the action space for the environment.
Definition taxi_env.h:55
virtual void make(const std::string &version, const std::unordered_map< std::string, std::any > &, const std::unordered_map< std::string, std::any > &) override final
make. Builds the environment. Optionally we can choose if the environment will be slippery
Definition taxi_env.cpp:38
~Taxi() override=default
~FrozenLake. Destructor.
ToyTextEnvBase< TimeStep< uint_t >, 500, 6 >::base_type base_type
The base type.
Definition taxi_env.h:39
virtual time_step_type step(const action_type &action) override final
step
Definition taxi_env.cpp:56
static const std::string name
name
Definition taxi_env.h:29
base_type::state_type state_type
The type of the action to be undertaken in the environment.
Definition taxi_env.h:65
static const std::string URI
The URI for accessing the environment.
Definition taxi_env.h:34
base_type::action_type action_type
The type of the action to be undertaken in the environment.
Definition taxi_env.h:60
base_type::state_space_type state_space_type
The type describing the state space for the environment.
Definition taxi_env.h:50
ToyTextEnvBase class. Base class for toy environments from Gymnasium. These environments have a discr...
Definition toy_text_base.h:34
Utility class to facilitate HTTP requests between the environments REST API and C++ drivers.
Definition rest_rl_env_client.h:29
Definition bitrl_consts.h:14