update
This commit is contained in:
11
src/mcts.jl
11
src/mcts.jl
@@ -220,9 +220,9 @@ end
|
|||||||
|
|
||||||
# Arguments
|
# Arguments
|
||||||
- `node::MCTSNode`
|
- `node::MCTSNode`
|
||||||
node of a search tree
|
leaf node of a search tree
|
||||||
- `simTrajectoryReward::T`
|
- `simTrajectoryReward::T`
|
||||||
total reward from all node in simulation trajectory
|
total reward from trajectory simulation
|
||||||
|
|
||||||
# Return
|
# Return
|
||||||
- `No return`
|
- `No return`
|
||||||
@@ -234,8 +234,11 @@ julia>
|
|||||||
|
|
||||||
# Signature
|
# Signature
|
||||||
"""
|
"""
|
||||||
function backpropagate(node::MCTSNode, simTrajectoryReward::T;
|
function backpropagate(node::MCTSNode, simTrajectoryReward::T;
|
||||||
discountRewardCoeff::AbstractFloat=0.9) where {T<:Number}
|
discountRewardCoeff::AbstractFloat=0.9) where {T<:Number}
|
||||||
|
# [WORKING] store best trajectory
|
||||||
|
isLeafNodeTerminalState = true
|
||||||
|
terminalStateReward = node.reward
|
||||||
while !isroot(node)
|
while !isroot(node)
|
||||||
# Update the statistics of the current node based on the result of the playout
|
# Update the statistics of the current node based on the result of the playout
|
||||||
node.visits += 1
|
node.visits += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user