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

New Dispatcher: Maximum travelling time

parent 5c41cda7
No related branches found
No related tags found
No related merge requests found
mutable struct map
speed_dict::Dict,
map::OpenStreetMapSpace, #TODO Figure out what Type this is
RM::Matrix{Int64}, #This should
t0::Float64
end
function get_preset_map(name):
presets =
map_specs=(:star_grid_map,(64,16)) map_specs=(:star_grid_map,(64,16))
#t0=readdlm(map_folder*"timescale.txt")[1]
#map #map
speed_dict=Dict(1=>3.6) speed_dict=Dict(1=>3.6)
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -33,7 +33,6 @@ include(settings_path) ...@@ -33,7 +33,6 @@ include(settings_path)
#TODO Is this actually needed? include("./sim_functions.jl")# #TODO Is this actually needed? include("./sim_functions.jl")#
#TODO Gucke ob die Ordner existieren
if !isdir(paths[:data]) if !isdir(paths[:data])
error("Please create data folder at $(paths[:data])") error("Please create data folder at $(paths[:data])")
...@@ -46,8 +45,8 @@ end ...@@ -46,8 +45,8 @@ end
map_folder = paths[:map] map_folder = paths[:map]
include(paths[:map]*"map.jl") # include(paths[:map]*"map.jl") #
include(paths[:dispatcher]*"dispatcher.jl") #include(paths[:dispatcher]*"dispatcher.jl")
# TODO Is this better in a seperate file? I think not, because I always will use the Same Dispatcher
x, y = indexing(index) x, y = indexing(index)
...@@ -63,7 +62,9 @@ specs=(; ...@@ -63,7 +62,9 @@ specs=(;
seed = 1, seed = 1,
request_type = request_type, request_type = request_type,
random_gens = random_gens, random_gens = random_gens,
t_max_wait = t_max_wait * t0 ) t_max_wait = t_max_wait * t0
t0 = t0,
)
specs = merge(specs, dispatcher) specs = merge(specs, dispatcher)
......
...@@ -59,9 +59,18 @@ end ...@@ -59,9 +59,18 @@ end
Function for Running a RidePooling simulation with the normalized Frequency x Function for Running a RidePooling simulation with the normalized Frequency x
""" """
function simulate_rp(paths::Dict, N::Int64, x, y, t0::Float64, specs, request_type; served = 10*N, requested=10*N) function simulate_rp(paths::Dict, N::Int64, x, y, t0::Float64, specs, request_type; served = 10*N, requested=10*N)
println("Get Model with with \nspecs=$specs") println("Get Model with with \nspecs=$specs")
#Make Model #Make Model
@time model=RP.get_model(;N_bus=N,ν=x/t0,specs...); @time model=RP.get_model(;N_bus=N,ν=x/t0,specs...);
println("Initializing Model to fill TODO List")
# Initialize Models to fill todo lists
model.request_type=:now
@time RP.run!(model;requested=15*N)
model.request_type=request_type
println("Start Simulation") println("Start Simulation")
@time RP.run!(model;requested=requested, served=served) @time RP.run!(model;requested=requested, served=served)
data = Dict() data = Dict()
......
...@@ -12,16 +12,16 @@ path="/scratch01.local/rhaag/$(String(request_type))/$name/" # Path were everyt ...@@ -12,16 +12,16 @@ path="/scratch01.local/rhaag/$(String(request_type))/$name/" # Path were everyt
# Simulation Settings # Simulation Settings
N = 10 #Number of Busses N = 20 #Number of Busses
requested = 2000 * N # Number of requests, that need to be made requested = 10000 * N # Number of requests, that need to be made
served = 2000 * N # Number of requests, that need to be served served = 10000 * N # Number of requests, that need to be served
#Random Generator #Random Generator
rng_type = :notRandom rng_type = :notRandom
# For mapping the 1D Index to 2D # For mapping the 1D Index to 2D
xBounds = (20, 60) xBounds = (20, 80) # Frequency ν = x/t0
yBounds = (0.1, 1.2) yBounds = (0.1, 1.5)
im_size = (40, 40) im_size = (40, 40)
indexing_method = getLogValue indexing_method = getLogValue
...@@ -31,8 +31,16 @@ t_max_wait = 2 ...@@ -31,8 +31,16 @@ t_max_wait = 2
# File Organization # File Organization
paths = Dict(:data => "/results/data/", paths = Dict(:data => "/results/data/",
:model => "/results/model/", :model => "/results/model/",
:map => "/example_map/map/", :map => "/example_map/map/"
:dispatcher => "/example_map/delays_wt1reldelta1/") #:dispatcher => "/example_map/delays_wt1reldelta1/"
# TODO Is this better in a seperate file? I think not, because I always will use the Same Dispatcher
)
dispatcher=(;
cost=:trajectory_length,
rejection_criterion=(((:total_travelling_time, 2, 0.5),))
)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#$ -cwd #$ -cwd
#$ -q grotrian.q #$ -q grotrian.q
#$ -j yes #$ -j yes
#$ -N testing3 #$ -N frequency_v_pickup_times
#$ -t 1-1600 #$ -t 1-1600
#$ -tc 500 #$ -tc 500
......
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