diff --git a/initialize.jl b/initialize.jl index 2e66284026625f0bb79153031432a5154beade55..8c087d3016ea011cfa8acce7c0360678e4b42f4d 100644 --- a/initialize.jl +++ b/initialize.jl @@ -53,11 +53,10 @@ function simulate_rp(paths::Dict, N::Int64, x, y, t0::Float64, specs; served = 1 # Save the calculated Data data = DataFrame(data) - #CSV.write(paths[:data]*"$(x)_$(y).csv", data) #QUESTION what savepath + #CSV.write(paths[:data]*"$(x)_$(y).csv", data) open(paths[:data]*"$index.csv", "w") do io writedlm(io, Iterators.flatten(([names(data)], eachrow(data))), ',') end #Save the model for possible later reference - RP.savemodel(paths[:model]*"$index.model",model;route_matrix=false) #QUESTION What savepath - # QUESTION How do I use the saving + RP.savemodel(paths[:model]*"$index.model",model;route_matrix=false) end diff --git a/put_together.jl b/put_together.jl index 885c0ab711c46a30fbb3007638087b8c99779b32..c62f76c4655afb3c39f15ffcdac9921abf0978e5 100644 --- a/put_together.jl +++ b/put_together.jl @@ -1,11 +1,40 @@ +using Plots +using CSV +path = ARGS[1] +len = eval(Meta.parse(ARGS[2])) +archive_path = ARGS[3] +xname = "frequency" +yname = "dt_earliest_pickup" +df = Dataframe(path*"1.csv") -for index in indxes + +for i in 2:len #TODO put all the generated CSV Files together into one big file which is then saved to the correct location + temp = DataFrame(path*"$i.csv") + append!(df, temp) end +println("Saving Combined Dataframe to $archive_path") +CSV.write(archive_path*"$name.csv", df) + +x, y = df[xname], df[yname] + +ks = names[df] +deleteat!(ks, xname) +deleteat!(ks, yname) +for name in ks + data = df[name] + map = heatmap(1:size(data,1), + 1:size(data,2), data, + #c=cgrad([:blue, :white,:red, :yellow]), + xlabel="Frequency", ylabel="dt_earliest_pickup", + title="$name") + savefig(path*"$name.png") +end + #TODO put all the generated models in an archive file and save it to the archiving location -#TODO make Plots from the CSV file +#TODO make Plots from the CSV files diff --git a/sim.jl b/sim.jl index 8ac38b6d1121d210240a38db4be16bd9d8f1c689..d68df3b0ab5fc69c85c8d651bc415f0c2ab4d730 100644 --- a/sim.jl +++ b/sim.jl @@ -1,6 +1,5 @@ -ENV["PYTHON"]="" using Pkg -Pkg.activate(".") +#Pkg.activate(".") #Pkg.add(url="https://gitlab.gwdg.de/smuehle1/RidePooling/", rev="planned_pickup") #Pkg.instantiate() #there may be an error here concerning PyCall. The dependencies assume Python to be installed on your system, with package 'matplotlib' installed.