From e5e91fc15f468952d00d2abbc5bd7e5da6485c97 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Fri, 10 May 2024 20:22:22 +0700 Subject: [PATCH] update --- src/mcts.jl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mcts.jl b/src/mcts.jl index 0c6e3f3..7bdd1d9 100644 --- a/src/mcts.jl +++ b/src/mcts.jl @@ -220,9 +220,9 @@ end # Arguments - `node::MCTSNode` - node of a search tree + leaf node of a search tree - `simTrajectoryReward::T` - total reward from all node in simulation trajectory + total reward from trajectory simulation # Return - `No return` @@ -234,8 +234,11 @@ julia> # Signature """ -function backpropagate(node::MCTSNode, simTrajectoryReward::T; - discountRewardCoeff::AbstractFloat=0.9) where {T<:Number} +function backpropagate(node::MCTSNode, simTrajectoryReward::T; + discountRewardCoeff::AbstractFloat=0.9) where {T<:Number} + # [WORKING] store best trajectory + isLeafNodeTerminalState = true + terminalStateReward = node.reward while !isroot(node) # Update the statistics of the current node based on the result of the playout node.visits += 1