【发布时间】:2022-11-17 05:36:05
【问题描述】:
我正在尝试编写一个接收元组和字典作为参数的函数。
function findBestAction(state::Tuple{Int64, Int64}, qTable::Dict{Any, Matrix{Float64}})
doSomething()
end
我希望函数接收其键可以是任何可能类型的字典。我运行以下命令但收到错误消息:
findBestAction((0, 0), qTable) #qTable::Dict{String, Matrix{Float64}}
错误信息:
Stacktrace:
[1] top-level scope
@ e:\Master Thesis\lu_jizhou\Learning\q_learning.jl:33
ERROR: MethodError: no method matching findBestAction(::Tuple{Int64, Int64}, ::Dict{String, Matrix{Float64}})
Closest candidates are:
findBestAction(::Tuple{Int64, Int64}, ::Dict{Any, Matrix{Float64}}) at e:\Master Thesis\lu_jizhou\Learning\q_learning.jl:33
Stacktrace:
[1] top-level scope
@ e:\Master Thesis\lu_jizhou\Learning\q_learning.jl:48
我该怎么做?
【问题讨论】: