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
Copy file name to clipboardExpand all lines: docs/src/generative.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ The *generative* interface consists of two functions:
19
19
The generative interface is typically used when it is easier to return sampled states and observations rather than explicit distributions as in the [Explicit interface](@ref explicit_doc).
20
20
This type of model is often referred to as a "black-box" model.
21
21
22
+
In some special cases (e.g. reinforcement learning with [RLInterface.jl](https://github.com/JuliaPOMDP/RLInterface.jl)), an initial observation is needed before any actions are taken. In this case, the [`initialobs`](@ref) function will be used.
23
+
22
24
## The [`gen`](@ref) function
23
25
24
26
The [`gen`](@ref) function has three versions differentiated by the type of the first argument.
Base.show_method_candidates(io, MethodError(gen, Tuple{DDNNode{ex.sym}, ex.modeltype, ex.dep_argtypes..., AbstractRNG}))# this is not exported - it may break
println(io, "\n\nThis error message uses heuristics to make recommendations for POMDPs.jl problem implementers. If it was misleading or you believe there is an inconsistency, please file an issue: https://github.com/JuliaPOMDP/POMDPs.jl/issues/new")
32
35
end
@@ -36,63 +39,78 @@ function distribution_impl_error(sym, func, modeltype, dep_argtypes)
@assertlength(rts) >0# there should always be the default NamedTuple() impl.
76
-
iflength(rts) ==1
84
+
iflength(rts) <=0# there should always be the default NamedTuple() impl.
85
+
@debug("Error analyzing the return types for gen. Please submit an issue at https://github.com/JuliaPOMDP/POMDPs.jl/issues/new", argtypes=argtypes, rts=rts)
86
+
elseiflength(rts) ==1
77
87
rt =first(rts)
78
88
if rt ==typeof(NamedTuple()) &&!implemented(gen, argtypes)
$impl # trick to get the compiler to insert the right backedges
113
111
catch
114
-
#TODO failed_synth_warning($this, $reqs)
115
112
throw(MethodError(initialstate, (p, rng)))
116
113
end
117
114
end
118
115
end
119
116
end
117
+
118
+
"""
119
+
initialobs(m::POMDP, s, rng::AbstractRNG)
120
+
121
+
Return a sampled initial observation for the problem `m` and state `s`.
122
+
123
+
This function is only used in cases where the policy expects an initial observation rather than an initial belief, e.g. in a reinforcement learning setting. It is not used in a standard POMDP simulation.
124
+
125
+
By default, it will fall back to `observation(m, s)`. The random number generator `rng` should be used to draw this sample (e.g. use `rand(rng)` instead of `rand()`).
Copy file name to clipboardExpand all lines: test/test_requirements.jl
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,10 @@ end
64
64
65
65
reqs =nothing# to check the hygeine of the macro
66
66
println("There should be a warning about no @reqs here:")
67
+
# 27 minutes has been spent trying to suppress this warning and automate a test for it. If you work more on it, please update this counter. The following things have been tried
0 commit comments