We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f035d6 commit bb74043Copy full SHA for bb74043
src/learner/mdplearner.jl
@@ -1,9 +1,9 @@
1
"""
2
- struct MDPLearner
3
- γ::Float64
4
- policy::Array{Int64, 1}
5
- values::Array{Float64, 1}
6
- mdp::MDP
+ @with_kw struct MDPLearner
+ mdp::MDP = MDP()
+ γ::Float64 = .9
+ policy::Array{Int64, 1} = ones(Int64, mdp.ns)
+ values::Array{Float64, 1} = zeros(mdp.ns)
7
8
Used to solve `mdp` with discount factor `γ`.
9
@@ -15,10 +15,6 @@ Used to solve `mdp` with discount factor `γ`.
15
end
16
export MDPLearner
17
18
-function MDPLearner(mdp, γ::Float64)
19
- return MDPLearner(γ = γ, mdp = mdp)
20
-end
21
-
22
@inline function selectaction(learner::MDPLearner,
23
policy::AbstractEpsilonGreedyPolicy, state)
24
if rand() < policy.ϵ
0 commit comments