This commit is contained in:
narawat lamaiin
2024-05-09 13:04:54 +07:00
parent ed63c19e66
commit 78d69194e9
4 changed files with 47 additions and 33 deletions

View File

@@ -137,17 +137,6 @@ function expand(a::T1, node::MCTSNode, decisionMaker::Function,
nthSample = 0
while nthSample < n
try
catch e
io = IOBuffer()
showerror(io, e)
errorMsg = String(take!(io))
st = sprint((io, v) -> show(io, "text/plain", v), stacktrace(catch_backtrace()))
println("")
@warn "Error occurred: $errorMsg\n$st"
println("")
end
thoughtDict = decisionMaker(a, node.state)
@@ -160,8 +149,9 @@ function expand(a::T1, node::MCTSNode, decisionMaker::Function,
if reward < 0
pprint(newstate[:thoughtHistory])
newstate[:evaluation] = stateevaluation
newstate[:feedback] = reflector(a, newstate)
print("done reflection")
newstate[:lesson] = reflector(a, newstate)
a.lesson[:lesson_1] = deepcopy(newstate)
print("---> reflector()")
end
if newNodeKey keys(node.children)