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 of int) – The shape of data that should be input to step or tick.

  • buffer_shape (list of int, 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 of float or float)

get_low()

The minimum value(s) for the action space.

Returns

the action space’s minimum value(s)

Return type

(list of float or float)

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

(list of int)

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 of int) – 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 of float or float) – the low value(s) for the action space. Can be a scalar or an array

  • high (list of float or float) –

    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 (list of int, 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 of float or float)

get_low()

The minimum value(s) for the action space.

Returns

the action space’s minimum value(s)

Return type

(list of float or float)

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 (list of int) – 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 of int, 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 of float or float)

get_low()

The minimum value(s) for the action space.

Returns

the action space’s minimum value(s)

Return type

(list of float or float)

sample()

Sample from the action space.

Returns

A valid command to be input to step or tick.

Return type

(np.ndarray)