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

Results after first run

parent 821e845a
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ data_type_functions = Dict(
:driven_distance => RP.driven_distance,
:requested_distance => RP.requested_distance,
:mean_relative_delay => RP.mean_relative_delay,
:mean_occupancy => RP.mean_occupancy,
# :mean_occupancy => RP.mean_occupancy, #BUG In Reading TUples from a CSV File
)
......@@ -40,7 +40,6 @@ end
function simulate_rp(paths::Dict, N::Int64, x, y, t0::Float64, specs; served = 10*N, requested=10*N)
#Make Model
#TODO Make Random gens
model=RP.get_model(;N_bus=N,ν=x/t0,specs...);
RP.run!(model;requested=requested, served=served)
data = Dict()
......@@ -53,9 +52,9 @@ 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)
#CSV.write(paths[:data]*"$index.csv", data)
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
#Save the model for possible later reference
RP.savemodel(paths[:model]*"$index.model",model;route_matrix=false)
......
using Plots
using CSV
using DataFrames
using DelimitedFiles
path = ARGS[1]
len = eval(Meta.parse(ARGS[2]))
......@@ -7,26 +9,30 @@ archive_path = ARGS[3]
xname = "frequency"
yname = "dt_earliest_pickup"
df = Dataframe(path*"1.csv")
lm = readdlm(path*"1.csv", ',', header=true, Any)
file=CSV.File(path*"1.csv")
println(file)
df = DataFrame(file)
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")
temp = DataFrame(CSV.File(path*"$i.csv"))
append!(df, temp)
end
println("Saving Combined Dataframe to $archive_path")
CSV.write(archive_path*"$name.csv", df)
CSV.write(archive_path*"results.csv", df)
x, y = df[xname], df[yname]
x, y = df[!,xname], df[!,yname]
ks = names[df]
deleteat!(ks, xname)
deleteat!(ks, yname)
ks = names(df)
print(ks)
filter!(e->e!= xname, ks)
filter!(e->e!= yname, ks)
for name in ks
data = df[name]
data = df[!,name]
map = heatmap(1:size(data,1),
1:size(data,2), data,
#c=cgrad([:blue, :white,:red, :yellow]),
......
results.csv 0 → 100644
This diff is collapsed.
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.
......
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