bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
env_types.h
Go to the documentation of this file.
1#ifndef BITSIM_ENV_TYPES_H
2#define BITSIM_ENV_TYPES_H
5
6namespace bitrl
7{
8namespace envs
9{
10
11template <uint_t state_end, uint_t action_end, uint_t state_start = 0, uint_t action_start = 0>
13{
14
19
24
29
34
39
44
50
56 static action_type sample_action(uint_t seed) { return action_space::sample(seed, true); }
57
58 static std::vector<action_type> sample_action(uint_t seed, uint_t size)
59 {
60 return action_space::sample(seed, size, true);
61 }
62};
63
64template <uint_t StateSpaceSize, uint_t action_end, uint_t action_start = 0,
65 typename StateSpaceItemType = real_t>
102
103template <uint_t StateSpaceSize, uint_t ActionSpaceSize, typename StateSpaceItemType = real_t,
104 typename ActionSpaceItemType = real_t>
137
138template <uint_t StateSpaceSize, uint_t action_end, typename real_range, uint_t action_start = 0,
139 typename StateSpaceItemType = real_t>
177
178template <uint_t StateSpaceSize, uint_t AS, uint_t AE, typename StateSpaceItemType = uint_t>
211
212} // namespace envs
213} // namespace bitrl
214
215#endif
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
Definition space_type.h:138
std::vector< StateSpaceItemType > space_item_type
Definition space_type.h:150
static constexpr uint_t size
Definition space_type.h:145
state_space::space_item_type state_type
the State type
Definition env_types.h:150
static constexpr real_range action_limits
the action limits
Definition env_types.h:160
real_range::value_type action_type
the Action type is real valued
Definition env_types.h:170
ScalarDiscreteSpace< action_start, action_end > action_space
item_t
Definition env_types.h:165
static constexpr uint_t STATE_SPACE_SIZE
state space size
Definition env_types.h:155
ContinuousVectorSpace< StateSpaceSize, StateSpaceItemType > state_space
The type of the state space.
Definition env_types.h:145
static constexpr uint_t ACTION_SPACE_SIZE
action space size
Definition env_types.h:175
action_space::space_item_type action_type
The type of action.
Definition env_types.h:135
ContinuousVectorSpace< ActionSpaceSize, ActionSpaceItemType > action_space
The type of the action space.
Definition env_types.h:125
ContinuousVectorSpace< StateSpaceSize, StateSpaceItemType > state_space
The type of the state space.
Definition env_types.h:110
state_space::space_item_type state_type
The type of state.
Definition env_types.h:120
action_space::space_item_type action_type
the Action type
Definition env_types.h:89
static constexpr uint_t STATE_SPACE_SIZE
state space size
Definition env_types.h:79
static action_type sample_action()
sample
Definition env_types.h:100
state_space::space_item_type state_type
the State type
Definition env_types.h:74
ScalarDiscreteSpace< action_start, action_end > action_space
item_t
Definition env_types.h:84
ContinuousVectorSpace< StateSpaceSize, StateSpaceItemType > state_space
Definition env_types.h:69
static constexpr uint_t ACTION_SPACE_SIZE
action space size
Definition env_types.h:94
Definition space_type.h:154
std::vector< T > space_item_type
item_t
Definition space_type.h:160
ScalarDiscreteSpace< AS, AE > action_space
the action space type
Definition env_types.h:199
DiscreteVectorSpace< StateSpaceSize, StateSpaceItemType > state_space
the state space type
Definition env_types.h:184
static constexpr uint_t ACTION_SPACE_SIZE
state space size
Definition env_types.h:209
static constexpr uint_t STATE_SPACE_SIZE
state space size
Definition env_types.h:194
action_space::space_item_type action_type
the Action type
Definition env_types.h:204
state_space::space_item_type state_type
the State type
Definition env_types.h:189
Definition env_types.h:13
ScalarDiscreteSpace< state_start, state_end > state_space
item_t
Definition env_types.h:18
action_space::space_item_type action_type
the Action type
Definition env_types.h:38
ScalarDiscreteSpace< action_start, action_end > action_space
the action space type
Definition env_types.h:33
static constexpr uint_t STATE_SPACE_SIZE
state space size
Definition env_types.h:28
static action_type sample_action()
sample
Definition env_types.h:49
static std::vector< action_type > sample_action(uint_t seed, uint_t size)
Definition env_types.h:58
static constexpr uint_t ACTION_SPACE_SIZE
action space size
Definition env_types.h:43
state_space::space_item_type state_type
the State type
Definition env_types.h:23
static action_type sample_action(uint_t seed)
sample
Definition env_types.h:56
A scalar discrete space can be used to denote a space that only has a single value at each time....
Definition space_type.h:22
static constexpr uint_t size
Definition space_type.h:38