1#ifndef MULTI_ARMED_BANDITS_H
2#define MULTI_ARMED_BANDITS_H
13#include <unordered_map>
61 static const std::string
name;
107 make(
const std::string &
version,
const std::unordered_map<std::string, std::any> &options,
108 const std::unordered_map<std::string, std::any> &
reset_options)
override final;
113 virtual void close() override final;
157 std::mt19937 generator_;
163 static std::atomic<uint_t> n_copies_;
179 std::vector<bitsim::maths::stats::BernoulliDist> bandits_;
MultiArmedBanditsSpace::state_space state_space_type
Definition env_base.h:45
MultiArmedBanditsSpace::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)
MultiArmedBanditsSpace::action_space action_space_type
Definition env_base.h:51
TimeStep< bool > time_step_type
Definition env_base.h:42
MultiArmedBanditsSpace::action_type action_type
Definition env_base.h:54
std::string version() const noexcept
Definition env_base.h:143
static uint_t n_copies()
Definition multi_armed_bandits.h:145
EnvBase< TimeStep< bool >, MultiArmedBanditsSpace > base_type
The base type.
Definition multi_armed_bandits.h:66
base_type::time_step_type time_step_type
The time step type we return every time a step in the environment is performed.
Definition multi_armed_bandits.h:72
virtual time_step_type reset() override final
Reset the environment.
uint_t n_actions() const noexcept
Return the number of actions.
Definition multi_armed_bandits.h:129
real_t fail_reward() const noexcept
Returns the fail reward.
Definition multi_armed_bandits.h:139
base_type::state_space_type state_space_type
The type describing the state space for the environment.
Definition multi_armed_bandits.h:77
real_t success_reward() const noexcept
Returns the sucees reward.
Definition multi_armed_bandits.h:134
base_type::action_type action_type
The type of the action to be undertaken in the environment.
Definition multi_armed_bandits.h:87
virtual void close() override final
close the environment
virtual time_step_type step(const action_type &action) override final
step in the environment by performing the given action
base_type::action_space_type action_space_type
The type of the action space for the environment.
Definition multi_armed_bandits.h:82
base_type::state_type state_type
The type of the action to be undertaken in the environment.
Definition multi_armed_bandits.h:92
static const std::string name
name
Definition multi_armed_bandits.h:61
MultiArmedBandits()
MultiArmedBandits Constructor.
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.
Definition multi_armed_bandits.h:19
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
struct MultiArmedBanditsSpace specifies the MultiArmedBandits state-action space
Definition multi_armed_bandits.h:26
Null state_type
The type of the state.
Definition multi_armed_bandits.h:36
Null action_space
The type of the action space for the environment.
Definition multi_armed_bandits.h:41
uint_t action_type
The type of the action to be undertaken in the environment.
Definition multi_armed_bandits.h:46
Null state_space
The type describing the state space for the environment.
Definition multi_armed_bandits.h:31
Null placeholder.
Definition bitsim_types.h:179