update
This commit is contained in:
@@ -64,7 +64,7 @@ function runMCTS(
|
|||||||
saveSimulatedNode::Bool=false,
|
saveSimulatedNode::Bool=false,
|
||||||
multithread=false,
|
multithread=false,
|
||||||
)::NamedTuple{(:root, :bestNextState, :bestTerminalState, :highValueStateList),
|
)::NamedTuple{(:root, :bestNextState, :bestTerminalState, :highValueStateList),
|
||||||
Tuple{MCTSNode,T,T,Vector{Any}}} where {T<:Any}
|
Tuple{MCTSNode,T,T,Vector{Dict{Symbol,Any}}}} where {T<:Any}
|
||||||
|
|
||||||
root = MCTSNode("root", initialstate, 0, 0, 0, 0, false, nothing, Dict{String,MCTSNode}(),
|
root = MCTSNode("root", initialstate, 0, 0, 0, 0, false, nothing, Dict{String,MCTSNode}(),
|
||||||
Dict{Symbol,Any}())
|
Dict{Symbol,Any}())
|
||||||
@@ -125,7 +125,7 @@ function runMCTS(
|
|||||||
bestTerminalState = selectBestTrajectoryNode(root)
|
bestTerminalState = selectBestTrajectoryNode(root)
|
||||||
|
|
||||||
# take all high value state from highValueState channel and put it in a list
|
# take all high value state from highValueState channel and put it in a list
|
||||||
highValueStateList = Any[]
|
highValueStateList = Vector{Dict{Symbol, Any}}()
|
||||||
while !isempty(highValueState)
|
while !isempty(highValueState)
|
||||||
push!(highValueStateList, take!(highValueState))
|
push!(highValueStateList, take!(highValueState))
|
||||||
end
|
end
|
||||||
@@ -136,7 +136,6 @@ function runMCTS(
|
|||||||
highValueStateList=highValueStateList)
|
highValueStateList=highValueStateList)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
""" Search the best action to take for a given state and task
|
""" Search the best action to take for a given state and task
|
||||||
|
|
||||||
# Arguments
|
# Arguments
|
||||||
|
|||||||
Reference in New Issue
Block a user