|
bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
|
#include <gym_walk.h>


Public Types | |
| typedef EnvBase< TimeStep< uint_t >, ScalarDiscreteEnv< state_size, 1, 0, 0 > > | base_type |
| typedef base_type::time_step_type | time_step_type |
| typedef base_type::state_space_type | state_space_type |
| typedef base_type::action_space_type | action_space_type |
| typedef base_type::action_type | action_type |
| typedef base_type::state_type | state_type |
| typedef std::vector< std::tuple< real_t, uint_t, real_t, bool > > | dynamics_t |
Public Types inherited from bitrl::envs::EnvBase< TimeStep< uint_t >, ScalarDiscreteEnv< state_size, 1, 0, 0 > > | |
| typedef TimeStep< uint_t > | time_step_type |
| Alias for the type returned when stepping the environment. | |
| typedef SpaceType::state_space | state_space_type |
| Type describing the environment state space. | |
| typedef SpaceType::state_type | state_type |
| Type describing an individual state. | |
| typedef SpaceType::action_space | action_space_type |
| Type describing the environment action space. | |
| typedef SpaceType::action_type | action_type |
| Type representing an individual action. | |
Public Types inherited from bitrl::envs::ScalarDiscreteEnv< state_size, 1, 0, 0 > | |
| typedef ScalarDiscreteSpace< state_start, state_end > | state_space |
| item_t | |
| typedef state_space::space_item_type | state_type |
| the State type | |
| typedef ScalarDiscreteSpace< action_start, action_end > | action_space |
| the action space type | |
| typedef action_space::space_item_type | action_type |
| the Action type | |
Public Member Functions | |
| GymWalk (network::RESTRLEnvClient &api_server) | |
| Constructor. | |
| 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 |
| Construct the environment instance. | |
| bool | is_alive () const |
| virtual void | close () override final |
| Close and release any acquired environment resources. | |
| virtual time_step_type | step (const action_type &action) override final |
| virtual time_step_type | reset () override final |
| Reset the environment to an initial state using the reset options specified during make. | |
| uint_t | n_states () const noexcept |
| uint_t | n_actions () const noexcept |
| dynamics_t | p (uint_t sidx, uint_t aidx) const |
| std::string | get_url () const |
| Get the full URL for this environment endpoint on the server. | |
| uint_t | n_copies () const |
Public Member Functions inherited from bitrl::envs::EnvBase< TimeStep< uint_t >, ScalarDiscreteEnv< state_size, 1, 0, 0 > > | |
| virtual | ~EnvBase ()=default |
| Virtual destructor. | |
| virtual time_step_type | step (const action_type &action)=0 |
| Perform one step in the environment using an action. | |
| const std::unordered_map< std::string, std::any > & | make_options () const noexcept |
| Access the configuration options provided to make(). | |
| const std::unordered_map< std::string, std::any > & | reset_options () const noexcept |
| Access the configuration options provided to make(). | |
| T | read_option (const std::string &op_name) const |
| Read a specific make() option and cast it to the requested type. | |
| std::string | idx () const noexcept |
| Get the id identifying this environment within a simulation batch. The id is valid only if make has been called. | |
| bool | is_created () const noexcept |
| Check if make() has successfully initialized the environment. | |
| std::string | env_name () const noexcept |
| Get the name of this environment instance. | |
| std::string | version () const noexcept |
| Get the environment version set during make(). | |
Static Public Attributes | |
| static const std::string | name = "GymWalk" |
| static const std::string | URI = "/gdrl/gym-walk-env" |
Static Public Attributes inherited from bitrl::envs::EnvBase< TimeStep< uint_t >, ScalarDiscreteEnv< state_size, 1, 0, 0 > > | |
| static const uint_t | DEFAULT_ENV_SEED |
| Default seed used in reset() if none provided. | |
Static Public Attributes inherited from bitrl::envs::ScalarDiscreteEnv< state_size, 1, 0, 0 > | |
| static constexpr uint_t | STATE_SPACE_SIZE |
| state space size | |
| static constexpr uint_t | ACTION_SPACE_SIZE |
| action space size | |
Additional Inherited Members | |
Static Public Member Functions inherited from bitrl::envs::ScalarDiscreteEnv< state_size, 1, 0, 0 > | |
| static action_type | sample_action () |
| sample | |
| static action_type | sample_action (uint_t seed) |
| sample | |
| static std::vector< action_type > | sample_action (uint_t seed, uint_t size) |
Protected Member Functions inherited from bitrl::envs::EnvBase< TimeStep< uint_t >, ScalarDiscreteEnv< state_size, 1, 0, 0 > > | |
| EnvBase (const std::string &idx=bitrl::consts::INVALID_STR, const std::string &name=bitrl::consts::INVALID_STR) | |
| Constructor (protected — for subclassing only). | |
| EnvBase (const EnvBase &) | |
| Copy constructor. | |
| void | set_version_ (const std::string &version) noexcept |
| Set internal version string. | |
| void | set_idx_ (const std::string &idx) noexcept |
| Set the id of the environment. | |
| void | set_make_options_ (const std::unordered_map< std::string, std::any > &options) noexcept |
| Store options for future access. | |
| void | set_reset_options_ (const std::unordered_map< std::string, std::any > &options) noexcept |
| Store reset options for future access. | |
| void | invalidate_is_created_flag_ () noexcept |
| Mark environment as not created. | |
| void | make_created_ () noexcept |
| Mark environment creation as successful. | |
| time_step_type & | get_current_time_step_ () noexcept |
| Mutable access to the current time step. | |
| const time_step_type & | get_current_time_step_ () const noexcept |
| Read-only access to the current time step. | |
| typedef base_type::action_space_type bitrl::envs::gdrl::GymWalk< state_size >::action_space_type |
| typedef base_type::action_type bitrl::envs::gdrl::GymWalk< state_size >::action_type |
| typedef EnvBase<TimeStep<uint_t>, ScalarDiscreteEnv<state_size, 1, 0, 0> > bitrl::envs::gdrl::GymWalk< state_size >::base_type |
| typedef std::vector<std::tuple<real_t, uint_t, real_t, bool> > bitrl::envs::gdrl::GymWalk< state_size >::dynamics_t |
| typedef base_type::state_space_type bitrl::envs::gdrl::GymWalk< state_size >::state_space_type |
| typedef base_type::state_type bitrl::envs::gdrl::GymWalk< state_size >::state_type |
| typedef base_type::time_step_type bitrl::envs::gdrl::GymWalk< state_size >::time_step_type |
| bitrl::envs::gdrl::GymWalk< state_size >::GymWalk | ( | network::RESTRLEnvClient & | api_server | ) |
Constructor.
|
finaloverridevirtual |
Close and release any acquired environment resources.
Implements bitrl::envs::EnvBase< TimeStep< uint_t >, ScalarDiscreteEnv< state_size, 1, 0, 0 > >.
|
inline |
Get the full URL for this environment endpoint on the server.
| bool bitrl::envs::gdrl::GymWalk< state_size >::is_alive | ( | ) | const |
|
finaloverridevirtual |
Construct the environment instance.
| version | Version string used to control environment variant |
| make_options | Key-value configuration options for environment creation. |
| reset_options | Key-value configuration how the environment should be reset |
Implements bitrl::envs::EnvBase< TimeStep< uint_t >, ScalarDiscreteEnv< state_size, 1, 0, 0 > >.
|
inlinenoexcept |
| uint_t bitrl::envs::gdrl::GymWalk< state_size >::n_copies | ( | ) | const |
Get the number of copies on the server for this environment
|
inlinenoexcept |
| GymWalk< state_size >::dynamics_t bitrl::envs::gdrl::GymWalk< state_size >::p | ( | uint_t | sidx, |
| uint_t | aidx | ||
| ) | const |
|
finaloverridevirtual |
Reset the environment to an initial state using the reset options specified during make.
Implements bitrl::envs::EnvBase< TimeStep< uint_t >, ScalarDiscreteEnv< state_size, 1, 0, 0 > >.
|
finaloverridevirtual |
|
static |
|
static |