Spaces¶
Contains action space definitions
Classes
ActionSpace (shape[, buffer_shape]) |
Abstract ActionSpace class. |
ContinuousActionSpace (shape[, low, high, …]) |
Action space that takes floating point inputs. |
DiscreteActionSpace (shape, low, high[, …]) |
Action space that takes integer inputs. |
-
class
holodeck.spaces.
ActionSpace
(shape, buffer_shape=None)¶ Abstract ActionSpace class.
Parameters: - shape (
list
ofint
) – The shape of data that should be input to step or tick. - buffer_shape (
list
ofint
, optional) –The shape of the data that will be written to the shared memory.
Only use this when it is different from shape.
Methods
get_high
()The maximum value(s) for the action space. get_low
()The minimum value(s) for the action space. sample
()Sample from the action space. Attributes
shape
Get the shape of the action space. -
get_high
()¶ The maximum value(s) for the action space.
Returns: the action space’s maximum value(s) Return type: ( list
offloat
orfloat
)
-
get_low
()¶ The minimum value(s) for the action space.
Returns: the action space’s minimum value(s) Return type: ( list
offloat
orfloat
)
-
sample
()¶ Sample from the action space.
Returns: A valid command to be input to step or tick. Return type: ( np.ndarray
)
-
shape
¶ Get the shape of the action space.
Returns: The shape of the action space. Return type: ( list
ofint
)
- shape (
-
class
holodeck.spaces.
ContinuousActionSpace
(shape, low=None, high=None, sample_fn=None, buffer_shape=None)¶ Action space that takes floating point inputs.
Parameters: - shape (
list
ofint
) – The shape of data that should be input to step or tick. - sample_fn (function, optional) – A function that takes a shape parameter and outputs a sampled command.
- low (
list
offloat
orfloat
) – the low value(s) for the action space. Can be a scalar or an array - high (
list
offloat
orfloat
) –the high value(s) for the action space. Cand be a scalar or an array
If this is not given, it will default to sampling from a unit gaussian.
- buffer_shape (
list
ofint
, optional) –The shape of the data that will be written to the shared memory.
Only use this when it is different from
shape
.
Methods
get_high
()The maximum value(s) for the action space. get_low
()The minimum value(s) for the action space. sample
()Sample from the action space. -
get_high
()¶ The maximum value(s) for the action space.
Returns: the action space’s maximum value(s) Return type: ( list
offloat
orfloat
)
-
get_low
()¶ The minimum value(s) for the action space.
Returns: the action space’s minimum value(s) Return type: ( list
offloat
orfloat
)
-
sample
()¶ Sample from the action space.
Returns: A valid command to be input to step or tick. Return type: ( np.ndarray
)
- shape (
-
class
holodeck.spaces.
DiscreteActionSpace
(shape, low, high, buffer_shape=None)¶ Action space that takes integer inputs.
Parameters: - shape (
list
ofint
) – The shape of data that should be input to step or tick. - low (
int
) – The lowest value to sample. - high (
int
) – The highest value to sample. - buffer_shape (
list
ofint
, optional) –The shape of the data that will be written to the shared memory.
Only use this when it is different from shape.
Methods
get_high
()The maximum value(s) for the action space. get_low
()The minimum value(s) for the action space. sample
()Sample from the action space. -
get_high
()¶ The maximum value(s) for the action space.
Returns: the action space’s maximum value(s) Return type: ( list
offloat
orfloat
)
-
get_low
()¶ The minimum value(s) for the action space.
Returns: the action space’s minimum value(s) Return type: ( list
offloat
orfloat
)
-
sample
()¶ Sample from the action space.
Returns: A valid command to be input to step or tick. Return type: ( np.ndarray
)
- shape (