This commit is contained in:
narawat lamaiin
2024-04-30 17:39:45 +07:00
parent bbdaa2248a
commit e558107284
2 changed files with 5 additions and 3 deletions

View File

@@ -131,8 +131,10 @@ function expand(a::T1, node::MCTSNode, state::T2, decisionMaker::Function, state
@show thoughtDict
newstate = MCTStransition(a, node.state, thoughtDict) #[] Implement your transition function
if newstate keys(node.children)
statetype = typeof(state)
if newstate keys(node.children) # BUG should be "key of the newstate" here not newstate
statetype = typeof(state)
# BUG should be node.children[key of newstate] here not newstate. may be a uuid
node.children[newstate] = MCTSNode(newstate, 0, 0.0, Dict{statetype, MCTSNode}())
end
end