update
This commit is contained in:
39
src/mcts.jl
39
src/mcts.jl
@@ -175,45 +175,6 @@ function expand(a::T1, node::MCTSNode, decisionMaker::Function,
|
|||||||
end
|
end
|
||||||
end
|
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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user