This commit is contained in:
narawat lamaiin
2024-05-10 20:22:22 +07:00
parent 97f565a3e9
commit e5e91fc15f

View File

@@ -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`
@@ -236,6 +236,9 @@ julia>
""" """
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