bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitrl::envs::grid_world::detail::board Struct Reference

#include <grid_world_env.h>

Public Member Functions

board_state_type init_board (uint_t board_s, GridWorldInitType init_type)
 initialize the board
board_state_type step (GridWorldActionType action)
 Execute the action on the board.
void move_piece (board_component_type piece, board_position pos)
 move_piece Move the pice to the given position
board_state_type get_state () const
 get_state. Returns the state of the board
real_t get_reward () const
 Get the reward the board currently returns depending on the position of the player.
void close ()
 close
void build_static_mode ()
 build_static_mode
void build_random_mode ()
 build_random_mode
void build_player_mode ()
 build_player_mode
void check_and_move (int_t row, int_t col)
 check if the given move is valid and change the position of the player if the move either causes the game to be lost (PIT) or is a valid move i.e. not stepping into the WALL or out of the board
board_move_type validate_move (board_component_type piece, board_position pos) const
 validate_move_

Public Attributes

uint_t board_size
uint_t seed = 42
std::mt19937 generator {42}
std::map< board_component_type, board_piece > components
std::map< std::string, board_mask > masks
bool is_board_init = {false}

Detailed Description

Represents the board

Member Function Documentation

◆ build_player_mode()

void bitrl::envs::grid_world::detail::board::build_player_mode ( )

build_player_mode

◆ build_random_mode()

void bitrl::envs::grid_world::detail::board::build_random_mode ( )

build_random_mode

◆ build_static_mode()

void bitrl::envs::grid_world::detail::board::build_static_mode ( )

build_static_mode

◆ check_and_move()

void bitrl::envs::grid_world::detail::board::check_and_move ( int_t row,
int_t col )

check if the given move is valid and change the position of the player if the move either causes the game to be lost (PIT) or is a valid move i.e. not stepping into the WALL or out of the board

◆ close()

void bitrl::envs::grid_world::detail::board::close ( )

close

◆ get_reward()

real_t bitrl::envs::grid_world::detail::board::get_reward ( ) const

Get the reward the board currently returns depending on the position of the player.

◆ get_state()

board_state_type bitrl::envs::grid_world::detail::board::get_state ( ) const

get_state. Returns the state of the board

Returns

◆ init_board()

board_state_type bitrl::envs::grid_world::detail::board::init_board ( uint_t board_s,
GridWorldInitType init_type )

initialize the board

◆ move_piece()

void bitrl::envs::grid_world::detail::board::move_piece ( board_component_type piece,
board_position pos )

move_piece Move the pice to the given position

Parameters
piece
pos

◆ step()

board_state_type bitrl::envs::grid_world::detail::board::step ( GridWorldActionType action)

Execute the action on the board.

◆ validate_move()

board_move_type bitrl::envs::grid_world::detail::board::validate_move ( board_component_type piece,
board_position pos ) const
nodiscard

validate_move_

Parameters
piece
pos

Member Data Documentation

◆ board_size

uint_t bitrl::envs::grid_world::detail::board::board_size

◆ components

std::map<board_component_type, board_piece> bitrl::envs::grid_world::detail::board::components

◆ generator

std::mt19937 bitrl::envs::grid_world::detail::board::generator {42}

◆ is_board_init

bool bitrl::envs::grid_world::detail::board::is_board_init = {false}

◆ masks

std::map<std::string, board_mask> bitrl::envs::grid_world::detail::board::masks

◆ seed

uint_t bitrl::envs::grid_world::detail::board::seed = 42

The documentation for this struct was generated from the following file: