SumTree¶
python_motion_planning.local_planner.dqn.SumTree
¶
Sum tree structure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
capacity
|
int
|
buffer capacity (must be even) |
required |
add(p, data)
¶
Adding data with priorities to the sum tree.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p
|
int
|
priority |
required |
data
|
tuple
|
data |
required |
get(s)
¶
Obtaining leaf node data based on the sampled value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
int
|
sampling priority |
required |
total()
¶
Returning the root node, i.e., the total priority weight.
update(idx, p)
¶
Update data of the sum tree.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
idx
|
int
|
tree node index |
required |
p
|
int
|
priority |
required |