diff --git a/Project.toml b/Project.toml index b150e1a9e6571e74de4a74222ef0a6ab0b25fc99..663c2ca72d24048ddd68c7985d8e6a86df09f0d7 100644 --- a/Project.toml +++ b/Project.toml @@ -24,3 +24,4 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" Agents = "= 4.1.3" OpenStreetMapX = "= 0.2.3" julia = "1.5" +RidePooling = "0.9" diff --git a/example/ruben/example_map/delays_wt1reldelta1/dispatcher.jl b/example/ruben/example_map/delays_wt1reldelta1/dispatcher.jl index 00e2e084de17264def20a2808a235f943dc00402..eae2b6ea9be51bc877f4c47f9d90fdf688e35c1c 100644 --- a/example/ruben/example_map/delays_wt1reldelta1/dispatcher.jl +++ b/example/ruben/example_map/delays_wt1reldelta1/dispatcher.jl @@ -3,6 +3,5 @@ max_relative_detour=1.0 dispatcher=(; cost=:delays, - rejection_criterion=((:any_waiting_time,max_waiting_time), - (:any_relative_detour,max_relative_detour)) + rejection_criterion=((:any_relative_detour,max_relative_detour)) ) diff --git a/example/ruben/scripts/script_fmax.sh b/example/ruben/scripts/script_fmax.sh index 255cfc7b8ba0a106725ca68e049e7ddf8f24f749..9ef23730fa466fd587984a01fc283d41fb01a700 100644 --- a/example/ruben/scripts/script_fmax.sh +++ b/example/ruben/scripts/script_fmax.sh @@ -4,12 +4,11 @@ #$ -cwd #$ -q titan.q #$ -j yes -#$ -N $SGE_TASK_ID +#$ -N earliest_pickup #$ -t 1-100 N=20 SAVE_PATH="./example/ruben/" -INDEX=1 -julia sim.jl $N $SAVE_PATH $INDEX +julia sim.jl $N $SAVE_PATH $SGE_TASK_ID diff --git a/initialize.jl b/initialize.jl index b75d93cb3fb42f1ea9dbfda3c2aec0cc0cfc4e1f..4e41a7d77b71674aac3bb8fb41f37a6f8c41a357 100644 --- a/initialize.jl +++ b/initialize.jl @@ -5,7 +5,6 @@ include("../RidePooling/src/RidePooling.jl") #How can I use using instead RP = RidePooling using DataFrames using DelimitedFiles -RP = RidePooling @@ -39,7 +38,7 @@ end """ Function for Running a RidePooling simulation with the normalized Frequency x """ -function simulate_rp(paths,N, x, t0, specs) +function simulate_rp(paths,N, x, y, t0, specs, served = 10*N, requested=10*N) #Make Model #TODO Make Random gens @@ -49,11 +48,12 @@ function simulate_rp(paths,N, x, t0, specs) data[:frequency] = x data[:dt_earliest_pickup] = y for (name, func) in data_type_functions - data[name] = [func(model),] + data[name] = func(model) end # Save the calculated Data data = DataFrame(data) + #CSV.write(paths[:data]*"$(x)_$(y).csv", data) #QUESTION what savepath open(paths[:data]*"$index.csv", "w") do io writedlm(io, Iterators.flatten(([names(data)], eachrow(data))), ',') diff --git a/sim.jl b/sim.jl index 9a6ad670763279efc3e4b2bdedc1b0410933d755..0f3181273f20d8c1c7bb31dccdb572b33c7415ac 100644 --- a/sim.jl +++ b/sim.jl @@ -51,13 +51,14 @@ end end + # Set the Filepaths paths = Dict(:data => "data/", :model => "model/", :map => "example_map/map/", :dispatcher => "example_map/delays_wt1reldelta1/") - +#TODO Gucke ob die Ordner existieren for (name, path) in paths paths[name] = save_path * path @@ -68,7 +69,7 @@ map_folder = paths[:map] requested = 20 * N served = 20 * N -include(paths[:map]*"map.jl") +include(paths[:map]*"map.jl") # include(paths[:dispatcher]*"dispatcher.jl") @@ -89,4 +90,4 @@ specs=(; specs = merge(specs, dispatcher) -data = simulate_rp(paths,N, x, t0, specs) +data = simulate_rp(paths,N, x, y, t0, specs, served=served, requested=requested)