pymgrid.utils.space.ModuleSpace#

class pymgrid.utils.space.ModuleSpace(unnormalized_low, unnormalized_high, normalized_bounds=(0, 1), clip_vals=True, shape=None, dtype=<class 'numpy.float64'>, seed=None, verbose=False)[source]#

Methods

clip(val, *[, low, high, space, normalized])

Clip a value into a lower and upper bound.

contains(x)

Check if x is a valid member of the space.

denormalize(val)

from_jsonable(sample_n)

Convert a JSONable data type to a batch of samples from this space.

inner_clip(val, space)

normalize(val)

sample([normalized])

Randomly sample an element of this space.

seed([seed])

Seed the PRNG of this space and possibly the PRNGs of subspaces.

to_jsonable(sample_n)

Convert a batch of samples from this space to a JSONable data type.

Attributes

is_np_flattenable

Checks whether this space can be flattened to a spaces.Box.

normalized

np_random

Lazily seed the PRNG since this is expensive and only needed if sampling from this space.

shape

Return the shape of the space as an immutable property.

unnormalized