Template Class Gridworld¶
Defined in File grid_world_env.h
Inheritance Relationships¶
Base Type¶
public bitrl::envs::EnvBase< TimeStep< detail::board_state_type >, detail::GridWorldEnv< side_size_ > >(Template Class EnvBase)
Class Documentation¶
-
template<uint_t side_size_>
class Gridworld : public bitrl::envs::EnvBase<TimeStep<detail::board_state_type>, detail::GridWorldEnv<side_size_>>¶ The Gridworld class models a square board. There are three ways to initialize the board.
static
random
player See the GridworldInitType enumeration. Static initialization means that the objects on the board are initialized at the same predetermined locations. Player initialization means that the player is initialized at a random position on the board. Random initialization means that all the objects are placed randomly
Public Types
-
typedef EnvBase<TimeStep<detail::board_state_type>, detail::GridWorldEnv<side_size_>> 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.
Public Functions
-
Gridworld()¶
Constructor.
-
virtual void make(const std::string &version, const std::unordered_map<std::string, std::any> &options) final override¶
make. Builds the environment. Optionally we can choose if the environment will be slippery
-
virtual time_step_type reset(uint_t, const std::unordered_map<std::string, std::any>&) final override¶
Reset the environment.
-
Gridworld make_copy(uint_t cidx) const¶
Create a new copy of the environment with the given copy index.
-
time_step_type step(const action_type &action) final override¶
step
- Parameters:
action –
- Returns:
-
virtual void close() final override¶
close
-
inline bool has_random_state() const noexcept¶
has_random_state
- Returns:
-
bool is_game_lost() const¶
Returns true if the PLAYER position is the same as the PIT position.
-
inline GridWorldInitType init_type() const noexcept¶
init_type
- Returns: