18#include <boost/noncopyable.hpp>
21#include <unordered_map>
38 DiscreteVectorStateDiscreteActionEnv<53, 0, 4, uint_t>>
45 static const std::string
name;
94 make(
const std::string &
version,
const std::unordered_map<std::string, std::any> &options,
95 const std::unordered_map<std::string, std::any> &
reset_options)
override final;
108 virtual void close() override final;
160 const uint_t player_id_1_{1};
165 const uint_t player_id_2_{2};
176 static std::atomic<uint_t> n_copies_;
181 std::vector<uint_t> board_;
186 bool is_finished_{
false};
191 board_ = std::vector<uint_t>();
DiscreteVectorStateDiscreteActionEnv< 53, 0, 4, uint_t >::state_space state_space_type
Definition env_base.h:45
void invalidate_is_created_flag_() noexcept
Definition env_base.h:203
DiscreteVectorStateDiscreteActionEnv< 53, 0, 4, uint_t >::state_type state_type
Definition env_base.h:48
const std::unordered_map< std::string, std::any > & reset_options() const noexcept
Definition env_base.h:105
EnvBase(const std::string &idx=bitsim::consts::INVALID_STR, const std::string &name=bitsim::consts::INVALID_STR)
DiscreteVectorStateDiscreteActionEnv< 53, 0, 4, uint_t >::action_space action_space_type
Definition env_base.h:51
virtual time_step_type reset()=0
TimeStep< std::vector< uint_t > > time_step_type
Definition env_base.h:42
DiscreteVectorStateDiscreteActionEnv< 53, 0, 4, uint_t >::action_type action_type
Definition env_base.h:54
std::string version() const noexcept
Definition env_base.h:143
EnvBase< TimeStep< std::vector< uint_t > >, DiscreteVectorStateDiscreteActionEnv< 53, 0, 4, uint_t > > base_type
The base type.
Definition connect2_env.h:52
uint_t n_actions() const noexcept
n_actions. Returns the number of actions
Definition connect2_env.h:123
bool has_legal_moves() const noexcept
Returns true if there are still legal moves to do.
base_type::state_space_type state_space_type
The type describing the state space for the environment.
Definition connect2_env.h:62
static const std::string name
name
Definition connect2_env.h:45
base_type::action_type action_type
The type of the action to be undertaken in the environment.
Definition connect2_env.h:72
base_type::time_step_type time_step_type
The type of the time step.
Definition connect2_env.h:57
time_step_type move(const uint_t pid, const action_type &action)
Make a move for the player with the given id.
virtual time_step_type step(const action_type &action) override final
step. Move in the environment with the given action This function always moves player_1
std::vector< uint_t > get_valid_moves() const
Get the valid moves.
base_type::state_type state_type
The state type.
Definition connect2_env.h:77
base_type::action_space_type action_space_type
The type of the action space for the environment.
Definition connect2_env.h:67
static uint_t n_copies()
Definition connect2_env.h:149
uint_t n_states() const noexcept
n_states. Returns the number of states
Definition connect2_env.h:118
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
make. Builds the environment. Optionally we can choose if the environment will be slippery
bool is_win(uint_t player) const noexcept
Returns true if the player has two stones in cells next to each other.
virtual time_step_type reset() override final
Reset the environment.
virtual void close() override final
close
Definition connect2_env.h:189
Definition connect2_env.h:29
Definition cart_pole.h:18
Various utilities used when working with RL problems.
Definition bitrl_log.h:25
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20
static constexpr uint_t size
size. The number of members in the space
Definition space_type.h:165
Definition env_types.h:180
static constexpr uint_t size
Definition space_type.h:38