qgym.spaces.box module
This module contains the Box space, i.e., a possibly open-ended interval in \(n\)
dimensions.
- Usage:
>>> from qgym.spaces import Box >>> Box(low=0, high=20, shape=(2, 3), dtype=int) Box([[0 0 0] [0 0 0]], [[20 20 20] [20 20 20]], (2, 3), int32)
- class qgym.spaces.box.Box(low, high, shape=None, dtype=<class 'numpy.float64'>, *, rng=None)[source]
Bases:
BoxAn \(n\)-dimensional box space, i.e., collection of (possibly) open-ended intervals.
- __init__(low, high, shape=None, dtype=<class 'numpy.float64'>, *, rng=None)[source]
Initialize a
Boxspace, i.e., a possibly open-ended interval in \(n\) dimensions.- Parameters:
low (
Union[SupportsFloat,Buffer,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]]]) – Either one lower bound for all intervals, or anNDArraywith the shape given in shape with unique lower bounds for each interval.high (
Union[SupportsFloat,Buffer,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]]]) – Either one upper bound for all intervals, or anNDArraywith the shape given in shape with unique upper bounds for each interval.shape (
Sequence[int] |None) –Tuplecontaining the shape of theBoxspace.dtype (
type[floating[Any]] |type[integer[Any]]) – Type of the values in each interval.rng (
Generator|None) – Random number generator to be used in this space, ifNonea new one will be constructed.