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