update
This commit is contained in:
@@ -452,14 +452,15 @@ function runMCTS(
|
|||||||
if node.isterminal
|
if node.isterminal
|
||||||
# MCTS arrive at the leaf node that is also a terminal state,
|
# MCTS arrive at the leaf node that is also a terminal state,
|
||||||
# do nothing then go directly to backpropagation
|
# do nothing then go directly to backpropagation
|
||||||
|
backpropagate(leafNode, node.reward)
|
||||||
else
|
else
|
||||||
expand(a, node, decisionMaker, progressValueEstimator, isterminal, n=n)
|
expand(a, node, decisionMaker, progressValueEstimator, isterminal, n=n)
|
||||||
leafNode = UCTselect(node, w)
|
leafNode = UCTselect(node, w)
|
||||||
simTrajectoryReward = simulate(a, leafNode, decisionMaker, progressValueEstimator,
|
simTrajectoryReward = simulate(a, leafNode, decisionMaker, progressValueEstimator,
|
||||||
isterminal, maxDepth, n=n)
|
isterminal, maxDepth, n=n)
|
||||||
end
|
|
||||||
backpropagate(leafNode, simTrajectoryReward)
|
backpropagate(leafNode, simTrajectoryReward)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
best_child_state = argmax([child.total_reward / child.visits for child in values(root.children)])
|
best_child_state = argmax([child.total_reward / child.visits for child in values(root.children)])
|
||||||
error("---> runMCTS")
|
error("---> runMCTS")
|
||||||
|
|||||||
Reference in New Issue
Block a user