Skip to content

Commit

Permalink
fixed warning on Dict([...]) construction
Browse files Browse the repository at this point in the history
  • Loading branch information
tawheeler committed Feb 16, 2017
1 parent 7e3a0ff commit d35c9ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lectures/MDPs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ type MappedDiscreteMDP <: MDP
actionIndex::Dict
nextStates
function MappedDiscreteMDP(S, A, T, R; discount=0.9)
stateIndex = [S[i]=>i for i = 1:length(S)]
actionIndex = [A[i]=>i for i = 1:length(A)]
nextStates = [(S[si], A[ai])=>S[find(T[si, ai, :])] for si=1:length(S), ai=1:length(A)]
stateIndex = Dict(S[i]=>i for i = 1:length(S))
actionIndex = Dict(A[i]=>i for i = 1:length(A))
nextStates = Dict((S[si], A[ai])=>S[find(T[si, ai, :])] for si=1:length(S), ai=1:length(A))
new(S, A, T, R, discount, stateIndex, actionIndex, nextStates)
end
end
Expand Down
4 changes: 2 additions & 2 deletions lectures/gridworld.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ function GridWorld()
R[10,4] = -0.8
R[100,4] = -0.8
discount = 0.9
nextStates = Dict([(S[si], A[ai])=>find(T[si, ai, :]) for si=1:length(S), ai=1:length(A)])
GridWorld(S, A, T, R, discount, Dict([A[i]=>i for i=1:length(A)]), nextStates)
nextStates = Dict((S[si], A[ai])=>find(T[si, ai, :]) for si=1:length(S), ai=1:length(A))
GridWorld(S, A, T, R, discount, Dict(A[i]=>i for i=1:length(A)), nextStates)
end

function colorval(val, brightness::Real = 1.0)
Expand Down

0 comments on commit d35c9ec

Please sign in to comment.