From d88c613b0e86aeb09800db0f7f06938dafabc4bc Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Fri, 10 May 2024 20:27:05 +0700 Subject: [PATCH] update --- src/mcts.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mcts.jl b/src/mcts.jl index 7bdd1d9..95c1d8d 100644 --- a/src/mcts.jl +++ b/src/mcts.jl @@ -237,7 +237,8 @@ julia> function backpropagate(node::MCTSNode, simTrajectoryReward::T; discountRewardCoeff::AbstractFloat=0.9) where {T<:Number} # [WORKING] store best trajectory - isLeafNodeTerminalState = true + fullTrajectoryReward = 0 + isLeafNodeTerminalState = node.isterminal terminalStateReward = node.reward while !isroot(node) # Update the statistics of the current node based on the result of the playout @@ -246,6 +247,7 @@ function backpropagate(node::MCTSNode, simTrajectoryReward::T; simTrajectoryReward *= discountRewardCoeff # discount because future reward is uncertain node = node.parent end + #XXX should I discount reward for fullTrajectoryReward calculation? end