Skip to content
Snippets Groups Projects
Commit 821e845a authored by Ruben Haag's avatar Ruben Haag
Browse files

Merge branch 'main' of gitlab.gwdg.de:rhaag/ridepooling_simulations into main

parents 8951dfee 710290fc
No related branches found
No related tags found
No related merge requests found
...@@ -53,11 +53,10 @@ function simulate_rp(paths::Dict, N::Int64, x, y, t0::Float64, specs; served = 1 ...@@ -53,11 +53,10 @@ function simulate_rp(paths::Dict, N::Int64, x, y, t0::Float64, specs; served = 1
# Save the calculated Data # Save the calculated Data
data = DataFrame(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 open(paths[:data]*"$index.csv", "w") do io
writedlm(io, Iterators.flatten(([names(data)], eachrow(data))), ',') writedlm(io, Iterators.flatten(([names(data)], eachrow(data))), ',')
end end
#Save the model for possible later reference #Save the model for possible later reference
RP.savemodel(paths[:model]*"$index.model",model;route_matrix=false) #QUESTION What savepath RP.savemodel(paths[:model]*"$index.model",model;route_matrix=false)
# QUESTION How do I use the saving
end end
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 #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 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 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
ENV["PYTHON"]=""
using Pkg using Pkg
Pkg.activate(".") #Pkg.activate(".")
#Pkg.add(url="https://gitlab.gwdg.de/smuehle1/RidePooling/", rev="planned_pickup") #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. #Pkg.instantiate() #there may be an error here concerning PyCall. The dependencies assume Python to be installed on your system, with package 'matplotlib' installed.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment