Class Pendulum

Inheritance Relationships

Base Type

  • public bitrl::envs::gymnasium::GymnasiumEnvBase< TimeStep< std::vector< real_t > >, ContinuousVectorStateContinuousScalarBoundedActionEnv< 3, 1, RealRange<-2.0, 2.0 >, 0, real_t > > (Template Class GymnasiumEnvBase)

Class Documentation

class Pendulum : public bitrl::envs::gymnasium::GymnasiumEnvBase<TimeStep<std::vector<real_t>>, ContinuousVectorStateContinuousScalarBoundedActionEnv<3, 1, RealRange<-2.0, 2.0>, 0, real_t>>

The Pendulum class. Interface for Pendulum environment.

Public Types

typedef GymnasiumEnvBase<TimeStep<std::vector<real_t>>, ContinuousVectorStateContinuousScalarBoundedActionEnv<3, 1, RealRange<-2.0, 2.0>, 0, real_t>>::base_type base_type

Base class 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 state.

Public Functions

Pendulum(const RESTApiServerWrapper &api_server)

Pendulum. Constructor.

Pendulum(const RESTApiServerWrapper &api_server, const uint_t cidx)

Constructor.

Pendulum(const Pendulum &other)

copy ctor

~Pendulum() = default

~Pendulum. Destructor

virtual void make(const std::string &version, const std::unordered_map<std::string, std::any>&) final override

make. Build the environment

virtual time_step_type step(const action_type &action) final override

step. Step in the environment following the given action

Pendulum make_copy(uint_t cidx) const

Create a new copy of the environment with the given copy index.

inline uint_t n_actions() const noexcept

n_actions. Returns the number of actions

Public Static Attributes

static const std::string name = "Pendulum"

name

static const std::string URI = "/gymnasium/pendulum-env"

The URI for accessing the environment.

Protected Functions

virtual time_step_type create_time_step_from_response_(const nlohmann::json &response) const final override

Handle the reset response from the environment server.