Skip to content

Commit

Permalink
Removed distrib abbreviation and replaced with distribution method name
Browse files Browse the repository at this point in the history
  • Loading branch information
Omastto1 committed Apr 22, 2021
1 parent 5a30cbc commit bbb501b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/fixhorizon.jl
Expand Up @@ -165,11 +165,11 @@ struct InStageDistribution{D}
end

"""
distrib(d::InStageDistribution{D})::D
distribution(d::InStageDistribution{D})::D
Return distrubution wrapped in InStageDistribution without stage
"""
function distrib(d::InStageDistribution)
function distribution(d::InStageDistribution)
return d.d
end

Expand All @@ -185,16 +185,16 @@ Base.rand(rng::AbstractRNG, s::Random.SamplerTrivial{<:InStageDistribution}) = (
function POMDPs.pdf(d::InStageDistribution, ss::Tuple{<:Any, Int})
s, k = ss
if k == stage(d)
return pdf(distrib(d), s)
return pdf(distribution(d), s)
else
return 0.0
end
end

POMDPs.mean(d::InStageDistribution) = (mean(distrib(d)), stage(d))
POMDPs.mode(d::InStageDistribution) = (mode(distrib(d)), stage(d))
POMDPs.support(d::InStageDistribution) = Iterators.product(support(distrib(d)), stage(d))
POMDPs.rand(r::AbstractRNG, d::FiniteHorizonPOMDPs.InStageDistribution) = (rand(r, distrib(d)), stage(d))
POMDPs.mean(d::InStageDistribution) = (mean(distribution(d)), stage(d))
POMDPs.mode(d::InStageDistribution) = (mode(distribution(d)), stage(d))
POMDPs.support(d::InStageDistribution) = Iterators.product(support(distribution(d)), stage(d))
POMDPs.rand(r::AbstractRNG, d::FiniteHorizonPOMDPs.InStageDistribution) = (rand(r, distribution(d)), stage(d))

#################################
# POMDPModelTools ordered actions
Expand Down

0 comments on commit bbb501b

Please sign in to comment.