diff --git a/Project.toml b/Project.toml index 68a8117..a184a19 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MDPs" uuid = "faa839ec-fb2b-412e-b807-f8b3264e2d6a" authors = ["Marek Petrik "] -version = "0.1.3" +version = "0.1.4" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" diff --git a/src/valuefunction/bellman.jl b/src/valuefunction/bellman.jl index d70997b..7dd00e0 100644 --- a/src/valuefunction/bellman.jl +++ b/src/valuefunction/bellman.jl @@ -56,7 +56,8 @@ value function `v` for an `objective`. There is no set representation for the value function. """ -@inline function qvalue(model::MDP{S,A}, objective::Objective, s::S, a::A, v) where {S,A} +function qvalue(model::MDP{S,A}, objective::Union{FiniteH, InfiniteH}, + s::S, a::A, v) where {S,A} val :: Float64 = 0.0 # much much faster than sum( ... for) for (sn, p, r) ∈ transition(model, s, a) @@ -74,7 +75,7 @@ value function `v` for a discount factor `γ`. This function is just a more efficient version of the standard definition. """ -@inline function qvalue(model::IntMDP, objective::Objective, +function qvalue(model::IntMDP, objective::Union{FiniteH, InfiniteH}, s::Int, a::Int, v::AbstractVector{<:Real}) x = model.states[s].actions[a] val = 0.0