This commit is contained in:
narawat lamaiin
2024-05-10 12:00:54 +07:00
parent a4ba292fad
commit 97f565a3e9

View File

@@ -175,45 +175,6 @@ function expand(a::T1, node::MCTSNode, decisionMaker::Function,
end
end
end
# function expand(a::T1, node::MCTSNode, decisionMaker::Function,
# progressValueEstimator::Function, reflector::Function; n::Integer=3) where {T1<:agent}
# nthSample = 0
# while nthSample <= n
# nthSample += 1
# println("---> expand() sample $nthSample")
# thoughtDict = decisionMaker(a, node.state)
# newNodeKey, newstate, reward, isterminalstate =
# MCTStransition(a, node.state, thoughtDict)
# # add progressValueEstimator
# stateevaluation, statevalue = progressValueEstimator(a, newstate)
# if reward < 0
# pprint(newstate[:thoughtHistory])
# newstate[:evaluation] = stateevaluation
# newstate[:lesson] = reflector(a, newstate)
# # store new lesson for later use
# lessonDict = copy(JSON3.read("lesson.json"))
# latestLessonKey, latestLessonIndice =
# GeneralUtils.findHighestIndexKey(state[:thoughtHistory], "lesson")
# nextIndice = latestLessonKey == :NA ? 1 : latestLessonIndice + 1
# newLessonKey = Symbol("lesson_$(nextIndice)")
# lessonDict[newLessonKey] = newstate
# open("lesson.json", "w") do io
# JSON3.pretty(io, lessonDict)
# end
# print("---> reflector()")
# end
# if newNodeKey ∉ keys(node.children)
# node.children[newNodeKey] = MCTSNode(newNodeKey, newstate, 0, statevalue,
# reward, isterminalstate, node, Dict{String, MCTSNode}())
# end
# end
# end