bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
cliff_world_env.h
Go to the documentation of this file.
1#ifndef CLIFF_WORLD_H
2#define CLIFF_WORLD_H
3
38
43#include "bitsim/extern/nlohmann/json/json.hpp"
44
45#include <any>
46#include <string>
47#include <tuple>
48#include <unordered_map>
49
50namespace bitrl
51{
52namespace envs::gymnasium
53{
54
58class CliffWorld final : public ToyTextEnvBase<TimeStep<uint_t>, 48, 4>
59{
60
61 public:
65 static const std::string name;
66
70 static const std::string URI;
71
75 typedef std::vector<std::tuple<real_t, uint_t, real_t, bool>> dynamics_type;
76
81
87
92
97
102
107
112
116 CliffWorld(const CliffWorld &other);
117
121 ~CliffWorld() = default;
122
127 virtual void
128 make(const std::string &version, const std::unordered_map<std::string, std::any> &options,
129 const std::unordered_map<std::string, std::any> &reset_options) override final;
130
136 virtual time_step_type step(const action_type &action) override final;
137
138 protected:
143
147 virtual time_step_type
148 create_time_step_from_response_(const nlohmann::json &response) const override final;
149};
150
151} // namespace envs::gymnasium
152} // namespace bitrl
153#endif // CLIFF_WORLD_H
SpaceType::state_space state_space_type
Type describing the environment state space.
Definition env_base.h:45
SpaceType::state_type state_type
Type describing an individual state.
Definition env_base.h:48
const std::unordered_map< std::string, std::any > & reset_options() const noexcept
Definition env_base.h:105
SpaceType::action_space action_space_type
Type describing the environment action space.
Definition env_base.h:51
TimeStepType time_step_type
Alias for the type returned when stepping the environment.
Definition env_base.h:42
SpaceType::action_type action_type
Type representing an individual action.
Definition env_base.h:54
~CliffWorld()=default
~CliffWorld. Destructor
virtual time_step_type step(const action_type &action) override final
step
std::vector< std::tuple< real_t, uint_t, real_t, bool > > dynamics_type
dynamics_t
Definition cliff_world_env.h:75
CliffWorld(network::RESTRLEnvClient &api_server)
CliffWorld.
base_type::action_type action_type
The type of the action to be undertaken in the environment.
Definition cliff_world_env.h:101
virtual void make(const std::string &version, const std::unordered_map< std::string, std::any > &options, const std::unordered_map< std::string, std::any > &reset_options) override final
make. Builds the environment. Optionally we can choose if the environment will be slippery
base_type::action_space_type action_space_type
The type of the action space for the environment.
Definition cliff_world_env.h:96
static const std::string URI
The URI for accessing the environment.
Definition cliff_world_env.h:70
base_type::time_step_type time_step_type
The time step type we return every time a step in the environment is performed.
Definition cliff_world_env.h:86
static const std::string name
name
Definition cliff_world_env.h:65
CliffWorld(const CliffWorld &other)
copy constructor
uint_t max_episode_steps_
Maximum episodes per step.
Definition cliff_world_env.h:142
ToyTextEnvBase< TimeStep< uint_t >, 48, 4 >::base_type base_type
The base type.
Definition cliff_world_env.h:80
base_type::state_space_type state_space_type
The type describing the state space for the environment.
Definition cliff_world_env.h:91
virtual time_step_type create_time_step_from_response_(const nlohmann::json &response) const override final
Handle the reset response from the environment server.
base_type::state_type state_type
The type of the action to be undertaken in the environment.
Definition cliff_world_env.h:106
ToyTextEnvBase(network::RESTRLEnvClient &api_server, const std::string &name)
Definition toy_text_base.h:113
Utility class to facilitate HTTP requests between the environments REST API and C++ drivers.
Definition rest_rl_env_client.h:28
Definition lunar_lander_env.h:18
Various utilities used when working with RL problems.
Definition bitrl_log.h:25
std::size_t uint_t
uint_t
Definition bitsim_types.h:40