Hi guys, I’m trying to execute a script file, but I got a message of SystemError:opening file Tensor1.txt: No such file or Directory. Actually the file Tensor1.txt is there inside the same folder. I can’t figure out why Julia 0.6.4 is not reading the file. I’m running this script file on Atom 1.29.
The code is:
# MDP problem description
# Get transition matrices
Tensor = Dict()
Tensor["1"] = readdlm("Tensor1.txt")
Tensor["2"] = readdlm("Tensor2.txt")
# Get reward function
Rewards = Dict()
Rewards["1"] = readdlm("Rewards1.txt")
Rewards["2"] = readdlm("Rewards2.txt")
# State space description
States = Dict()
States["#states"] = size(Tensor["1"],1)
States["FeatSize"] = [2,162]
Actions = Dict()
Actions["#actions"] = 2
Constraints = Dict()
Constraints["#constraints"] = 1
Constraints["States"] = [52]
# Initial condition
init = 1
λ = 0.7
VXpolicy = CMDP(States,Actions,
Tensor,Rewards,
λ,init,zeros(3),Constraints)
(Values,Policy) = SolveCMDP(VXpolicy);
TotalStates = States["#states"]
MC = zeros(TotalStates,TotalStates)
for i = 1:TotalStates
ind = Policy[i]
MC[i,:] = Tensor["$(ind)"][i,:]
end
``
``` LoadError: e[91mSystemError: opening file Tensor1.txt: No such file or directorye[39m
while loading /Users/marcelord12/Documents/phd2018/mppo/thesis/MDP/LP/Sample.jl, in expression starting on line 7
#systemerror#44 at error.jl:64 [inlined]
systemerror(::String, ::Bool) at error.jl:64
open(::String, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at iostream.jl:104
open(::Base.#readstring, ::String) at iostream.jl:150
#readdlm_auto#11(::Array{Any,1}, ::Function, ::String, ::Char, ::Type{T} where T, ::Char, ::Bool) at datafmt.jl:134
#readdlm#7 at datafmt.jl:81 [inlined]
readdlm(::String, ::Char, ::Char) at datafmt.jl:81
#readdlm#5(::Array{Any,1}, ::Function, ::String) at datafmt.jl:64
readdlm(::String) at datafmt.jl:64
include_string(::String, ::String) at loading.jl:522
include_string(::Module, ::String, ::String) at Compat.jl:88
(::Atom.##112#116{String,String})() at eval.jl:109
withpath(::Atom.##112#116{String,String}, ::String) at utils.jl:30
withpath(::Function, ::String) at eval.jl:38
hideprompt(::Atom.##111#115{String,String}) at repl.jl:67
macro expansion at eval.jl:106 [inlined]
(::Atom.##110#114{Dict{String,Any}})() at task.jl:80```