Class Connect2¶
Defined in File connect2_env.h
Inheritance Relationships¶
Base Type¶
public bitrl::envs::EnvBase< TimeStep< std::vector< uint_t > >, DiscreteVectorStateDiscreteActionEnv< 53, 0, 4, uint_t > >(Template Class EnvBase)
Class Documentation¶
-
class Connect2 : public bitrl::envs::EnvBase<TimeStep<std::vector<uint_t>>, DiscreteVectorStateDiscreteActionEnv<53, 0, 4, uint_t>>¶
Implementation of Connect2 environment from https://github.com/JoshVarty/AlphaZeroSimple Initially the environment has all its positions set to zero. When a player makes a move then the position corresponding to this move.
Public Types
-
typedef EnvBase<TimeStep<std::vector<uint_t>>, DiscreteVectorStateDiscreteActionEnv<53, 0, 4, uint_t>> base_type¶
The base type.
-
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
-
Connect2()¶
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 step(const action_type &action) final override¶
step. Move in the environment with the given action This function always moves player_1
- Parameters:
action –
- Returns:
-
inline virtual void close() final override¶
close
-
virtual time_step_type reset(uint_t, const std::unordered_map<std::string, std::any>&) final override¶
Reset the environment.
-
Connect2 make_copy(uint_t cidx) const¶
Create a new copy of the environment with the given copy index.
-
time_step_type move(const uint_t pid, const action_type &action)¶
Make a move for the player with the given id.
-
bool has_legal_moves() const noexcept¶
Returns true if there are still legal moves to do.
Public Static Attributes
-
static const std::string name = "Connect2"¶
name
-
typedef EnvBase<TimeStep<std::vector<uint_t>>, DiscreteVectorStateDiscreteActionEnv<53, 0, 4, uint_t>> base_type¶