Spaces¶
Contains action space definitions
Classes:
|
Abstract ActionSpace class. |
|
Action space that takes floating point inputs. |
|
Action space that takes integer inputs. |
-
class
holodeck.spaces.ActionSpace(shape, buffer_shape=None)¶ Abstract ActionSpace class.
- Parameters
shape (
listofint) – The shape of data that should be input to step or tick.buffer_shape (
listofint, 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:
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
(
listoffloatorfloat)
-
get_low()¶ The minimum value(s) for the action space.
- Returns
the action space’s minimum value(s)
- Return type
(
listoffloatorfloat)
-
sample()¶ Sample from the action space.
- Returns
A valid command to be input to step or tick.
- Return type
(
np.ndarray)
-
property
shape¶ Get the shape of the action space.
- Returns
The shape of the action space.
- Return type
(
listofint)
-
class
holodeck.spaces.ContinuousActionSpace(shape, low=None, high=None, sample_fn=None, buffer_shape=None)¶ Action space that takes floating point inputs.
- Parameters
shape (
listofint) – 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 (
listoffloatorfloat) – the low value(s) for the action space. Can be a scalar or an arrayhigh (
listoffloatorfloat) –the high value(s) for the action space. Can be a scalar or an array
If this is not given, it will default to sampling from a unit gaussian.
buffer_shape (
listofint, 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
(
listoffloatorfloat)
-
get_low()¶ The minimum value(s) for the action space.
- Returns
the action space’s minimum value(s)
- Return type
(
listoffloatorfloat)
-
sample()¶ Sample from the action space.
- Returns
A valid command to be input to step or tick.
- Return type
(
np.ndarray)
-
class
holodeck.spaces.DiscreteActionSpace(shape, low, high, buffer_shape=None)¶ Action space that takes integer inputs.
- Parameters
shape (
listofint) – 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 (
listofint, 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
(
listoffloatorfloat)
-
get_low()¶ The minimum value(s) for the action space.
- Returns
the action space’s minimum value(s)
- Return type
(
listoffloatorfloat)
-
sample()¶ Sample from the action space.
- Returns
A valid command to be input to step or tick.
- Return type
(
np.ndarray)