You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Holy-style trait that describes whether the space is continuous, finite discrete, or an unknown type. See CommonRLInterface for a more detailed description of the styles.
"Return the size of the objects in a space. This is guaranteed to be defined if the objects in the space are arrays, but otherwise it may not be defined."
33
35
function elsize end# note: different than Base.elsize
34
36
37
+
"""
38
+
bounds(space)
39
+
40
+
Return a `Tuple` containing lower and upper bounds for the elements in a space.
41
+
42
+
For example, if `space` is a unit circle, `bounds(space)` will return `([-1.0, -1.0], [1.0, 1.0])`. This allows agents to choose policies that appropriately cover the space e.g. a normal distribution with a mean of `mean(bounds(space))` and a standard deviation of half the distance between the bounds.
43
+
44
+
`bounds` should be defined for ContinuousSpaceStyle spaces.
45
+
46
+
# Example
47
+
```juliadoctest
48
+
julia> bounds(1..2)
49
+
(1, 2)
50
+
```
51
+
"""
35
52
function bounds end
36
53
54
+
"""
55
+
clamp(x, space)
56
+
57
+
Return an element of `space` that is near `x`.
58
+
59
+
For example, if `space` is a unit circle, `clamp([2.0, 0.0], space)` might return `[1.0, 0.0]`. This allows for a convenient way for an agent to find a valid action if they sample actions from a distribution that doesn't match the space exactly (e.g. a normal distribution).
Copy file name to clipboardExpand all lines: src/product.jl
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,16 @@ struct TupleProduct{T<:Tuple}
18
18
ss::T
19
19
end
20
20
21
+
"""
22
+
TupleProduct(space1, space2, ...)
23
+
24
+
Create a space representing the Cartesian product of the argument. Each element is a `Tuple` containing one element from each of the constituent spaces.
25
+
26
+
Use `subspaces` to access a `Tuple` containing the constituent spaces.
0 commit comments