Template Class GymnasiumEnvBase

Inheritance Relationships

Base Type

Derived Types

Class Documentation

template<typename TimeStepType, typename SpaceType>
class GymnasiumEnvBase : public bitrl::envs::EnvBase<TimeStepType, SpaceType>

class GymnasiumEnvBase. Base class for all Gymnasium wrappers The class has two parameters:

TimeStepType: the type of the time step to use

SpaceType: The type of the space-action space

Subclassed by bitrl::envs::gymnasium::GymnasiumVecEnvBase< VectorTimeStep< detail_::AcrobotVEnv::state_type >, detail_::AcrobotVEnv >, bitrl::envs::gymnasium::ToyTextEnvBase< TimeStep< uint_t >, 48, 2 >, bitrl::envs::gymnasium::ToyTextEnvBase< TimeStep< uint_t >, 37, 4 >, bitrl::envs::gymnasium::ToyTextEnvBase< TimeStep< uint_t >, frozenlake_state_size< side_size >::size, 3 >, bitrl::envs::gymnasium::ToyTextEnvBase< TimeStep< uint_t >, 500, 6 >, bitrl::envs::gymnasium::lunar_lander_detail::_LunarLanderEnv< TimeStep< std::vector< real_t > >, ContinuousVectorStateContinuousVectorActionEnv< 8, 2, real_t, real_t > >, bitrl::envs::gymnasium::lunar_lander_detail::_LunarLanderEnv< TimeStep< std::vector< real_t > >, ContinuousVectorStateDiscreteActionEnv< 8, 4, 0, real_t > >, bitrl::envs::gymnasium::lunar_lander_detail::_LunarLanderEnv< TimeStepType, SpaceType >

Public Types

typedef EnvBase<TimeStepType, SpaceType> base_type

The base_type.

typedef base_type::time_step_type time_step_type

The time step type we return every time a step in the environment is performed.

typedef base_type::state_space_type state_space_type

The type describing the state space for the environment.

typedef base_type::action_space_type action_space_type

The type of the action space for the environment.

typedef base_type::action_type action_type

The type of the action to be undertaken in the environment.

typedef base_type::state_type state_type

The type of the action to be undertaken in the environment.

Public Functions

virtual ~GymnasiumEnvBase()

~GymnasiumEnvBase. Destructor.

virtual bool is_alive() const
virtual void close() override

close the environment

virtual time_step_type reset(uint_t seed, const std::unordered_map<std::string, std::any> &options) override

Reset the environment.

inline const RESTApiServerWrapper &get_api_server() const

Returns read reference to the underlying API server wrapper.

std::string get_url() const

Returns the full path on the server for this environment.

virtual time_step_type reset(uint_t seed, const std::unordered_map<std::string, std::any> &options) = 0

Expose the various reset methods we use from base class.

inline time_step_type reset()

Expose the various reset methods we use from base class.

inline time_step_type reset(uint_t seed)

Expose the various reset methods we use from base class.

Protected Functions

GymnasiumEnvBase(const RESTApiServerWrapper &api_server, const uint_t cidx, const std::string &name)

Constructor.

GymnasiumEnvBase(const GymnasiumEnvBase&)

Copy constructor.

inline RESTApiServerWrapper &get_api_server()

read reference to the api server instance

virtual time_step_type create_time_step_from_response_(const nlohmann::json &response) const = 0

build the time step from the server response

Protected Attributes

RESTApiServerWrapper api_server_

Pointer to the api server that handles the requests.