Action 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 holoocean.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:

(list of float or float): the action space’s maximum value(s)

get_low()

The minimum value(s) for the action space.

Returns:

(list of float or float): the action space’s minimum value(s)

sample()

Sample from the action space.

Returns:

(np.ndarray): A valid command to be input to step or tick.

property shape

Get the shape of the action space.

Returns:

(list of int): The shape of the action space.

class holoocean.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. Cand 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:

(list of float or float): the action space’s maximum value(s)

get_low()

The minimum value(s) for the action space.

Returns:

(list of float or float): the action space’s minimum value(s)

sample()

Sample from the action space.

Returns:

(np.ndarray): A valid command to be input to step or tick.

class holoocean.spaces.DiscreteActionSpace(shape, low, high, buffer_shape=None)

Action space that takes integer inputs.

Args:

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:

(list of float or float): the action space’s maximum value(s)

get_low()

The minimum value(s) for the action space.

Returns:

(list of float or float): the action space’s minimum value(s)

sample()

Sample from the action space.

Returns:

(np.ndarray): A valid command to be input to step or tick.