Struct board

Struct Documentation

struct board

Represents the board

Public 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

Parameters:
  • piece

  • pos

board_state_type get_state() const

get_state. Returns the state of the board

Returns:

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(uint_t seed)

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_

Parameters:
  • piece

  • pos

Public Members

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