1#ifndef EXAMPLES_CLIFF_WALK_H
2#define EXAMPLES_CLIFF_WALK_H
49 if (a == 0 && row > 0)
51 else if (a == 1 && col <
N_COLS - 1)
53 else if (a == 2 && row <
N_ROWS - 1)
55 else if (a == 3 && col > 0)
68 state_ =
move(state_, a);
81 template <
typename Policy>
static std::string
draw(
const Policy &policy)
97 s =
move(s, policy(s));
99 grid[at(
START)] =
'S';
100 grid[at(
GOAL)] =
'G';
Forward declaration.
Definition time_step.h:22
Definition cliff_walk.h:26
static std::string draw(const Policy &policy)
Definition cliff_walk.h:81
static bool is_cliff(bitrl::uint_t s)
Definition cliff_walk.h:40
bitrl::uint_t state_type
Definition cliff_walk.h:33
static bitrl::uint_t move(bitrl::uint_t s, bitrl::uint_t a)
Definition cliff_walk.h:45
time_step_type step(action_type a)
Definition cliff_walk.h:66
static constexpr bitrl::uint_t START
Definition cliff_walk.h:30
bitrl::uint_t n_actions() const noexcept
Definition cliff_walk.h:38
static constexpr bitrl::uint_t N_COLS
Definition cliff_walk.h:29
static constexpr bitrl::uint_t N_ROWS
Definition cliff_walk.h:28
bitrl::uint_t action_type
Definition cliff_walk.h:34
static constexpr bitrl::uint_t GOAL
Definition cliff_walk.h:31
time_step_type reset()
Definition cliff_walk.h:60
bitrl::uint_t n_states() const noexcept
Definition cliff_walk.h:37
bitrl::TimeStep< bitrl::uint_t > time_step_type
Definition cliff_walk.h:35
@ MID
Definition time_step_type.h:17
@ FIRST
Definition time_step_type.h:16
@ LAST
Definition time_step_type.h:18
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
Definition cliff_walk.h:23