我一直在尝试转换一些用0.7编写的Julia代码:
type SCA <: DiscreteMDP
nStates::Int64
nActions::Int64
actions::Vector{Symbol}
grid::RectangleGrid
function SCA()
grid = RectangleGrid(Ranges, Thetas, Bearings, Speeds, Speeds,Responses, Responses)
return new(NStates, NActions, Actions, grid)
end # function SCA
end # type SCA
使用的软件包DiscreteMDP已被弃用,并被POMDPS.jl取代,我对如何成功转换它感到困惑。这是我目前拥有的:
mutable struct SCA <: MDP{Int64,Vector{Symbol}}#Something is wrong here
nStates::Int64
nActions::Int64
actions::Vector{Symbol}
grid::RectangleGrid
function SCA()
grid = RectangleGrid(Ranges, Thetas, Bearings, Speeds, Speeds, Responses, Responses)
return new{Int64,Int64,Vector{Symbol},RectangleGrid}(NStates, NActions, Actions, grid)#Probably something Wrong here
#Creating a new SCA does not know that MDP is a superclass. Inheritance isnt working
end # function SCA
end # type SCA
在POMDPs.jl文件中,有抽象类的描述:
"""
MDP{S,A}
Abstract base type for a fully observable Markov decision process.
S: state type
A: action type
"""
abstract type MDP{S,A} end
我不确定从这里继续前进,有什么想法吗?谢谢!