This repository has been archived by the owner on Aug 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
tree.jl
51 lines (42 loc) · 1.58 KB
/
tree.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
abstract BeliefNode{S,A,O,B}
# Note: links to parents were taken out because they hadn't been used in anything we've done so far
# Note: the label is really only important for visualization
type ActNode{A, O, BNodeType <: BeliefNode} # Need A, O, everything in belief
label::A # for keeping track of which action this corresponds to
N::Int64
V::Float64
children::Dict{O, BNodeType} # maps observations to ObsNodes
end
type DPWObsNode{S,A,O,Belief} <: BeliefNode{S,A,O,Belief}
label::O
state::S
reward::Float64
N::Int64
B::Belief # belief/state distribution
children::Dict{A,ActNode{A,O,DPWObsNode{S,A,O,Belief}}}
end
type ObsNode{S,A,O,Belief} <: BeliefNode{S,A,O,Belief}
label::O
N::Int64
B::Belief # belief/state distribution
children::Dict{A,ActNode{A,O,ObsNode{S,A,O,Belief}}}
end
type RootNode{RootBelief} <: BeliefNode
N::Int64
B::RootBelief # belief/state distribution
children::Dict{Any,ActNode} # ActNode not parameterized here to make initialize_belief more flexible
end
"""
init_V(problem::POMDPs.POMDP, h::BeliefNode, action)
Return the initial value (V) associated with a new action node when it is created. This can be used in concert with `init_N` to incorporate prior experience into the solver.
"""
function init_V(problem::POMDPs.POMDP, h::BeliefNode, action)
return 0.0
end
"""
init_N(problem::POMDPs.POMDP, h::BeliefNode, action)
Return the initial number of queries (N) associated with a new action node when it is created.
"""
function init_N(problem::POMDPs.POMDP, h::BeliefNode, action)
return 0
end