Skip to content
Snippets Groups Projects
Commit 7ebe20ab authored by rhaag's avatar rhaag
Browse files

V0.1

parent 044a2369
No related branches found
No related tags found
No related merge requests found
......@@ -24,3 +24,4 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Agents = "= 4.1.3"
OpenStreetMapX = "= 0.2.3"
julia = "1.5"
RidePooling = "0.9"
......@@ -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))
)
......@@ -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
......@@ -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))), ',')
......
......@@ -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)
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