From fb8e8231cbc0dffab7dd64d994f78f5933d14f94 Mon Sep 17 00:00:00 2001 From: Ruben Haag <rhaag@uran001.dcf.ds.mpg.de> Date: Mon, 29 Nov 2021 23:22:53 +0100 Subject: [PATCH] Version that is working on the cluster --- Project.toml | 2 +- initialize.jl | 8 ++++---- initialize.sh | 2 +- sim.jl | 10 ++++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Project.toml b/Project.toml index a77f603..0daee06 100644 --- a/Project.toml +++ b/Project.toml @@ -1,4 +1,4 @@ -name = "ridepooling_si,ulatioms" +name = "ridepooling_simulatioms" authors = ["Ruben Haag<ruben.haag@stud.uni-goettingen.de>"] version = "0.1.0" diff --git a/initialize.jl b/initialize.jl index 96c3154..2e66284 100644 --- a/initialize.jl +++ b/initialize.jl @@ -26,14 +26,14 @@ save_path = "" #TODO What savepath? function getValue(index, xmin, xmax, xlen, ymin, ymax, ylen) xstep = (xmax-xmin)/xlen ystep = (ymax-ymin)/ylen - xs = xmin:xstep:xmax - ys = ymin:ystep:ymax - x = xs[index%xlen + 1] - y = ys[index - index%xlen + 1] + + x = (index%xlen) * xstep + xmin + y = trunc(Int64, index/ylen) * ystep + ymin return x,y end + """ Function for Running a RidePooling simulation with the normalized Frequency x """ diff --git a/initialize.sh b/initialize.sh index 1f62b86..666ce6f 100755 --- a/initialize.sh +++ b/initialize.sh @@ -3,7 +3,7 @@ N=1 -SAVE_PATH="${PWD}/results/" +SAVE_PATH="/scratch01.local/rhaag/earliest_pickup/results/" INDEX=1 DATA_PATH="${SAVE_PATH}data/" MODEL_PATH="${SAVE_PATH}model/" diff --git a/sim.jl b/sim.jl index b1215e4..c8731c2 100644 --- a/sim.jl +++ b/sim.jl @@ -1,7 +1,9 @@ +ENV["PYTHON"]="" using Pkg 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. +#Pkg.instantiate() #there may be an error here concerning PyCall. The dependencies assume Python to be installed on your system, with package 'matplotlib' installed. #Either just run 'conda install -c conda-forge matplotlib' in your system shell, or follow instructions below (after running this cell and getting an error) to solve everything from within Julia. import RidePooling @@ -71,15 +73,15 @@ if !isdir(paths[:model]) end map_folder = paths[:map] -requested = 20 * N -served = 20 * N +requested = 100 * N +served = 100 * N include(paths[:map]*"map.jl") # include(paths[:dispatcher]*"dispatcher.jl") -x, y = getValue(index, 0, 100, 10, 1, 5, 10) +x, y = getValue(index-1, 0, 100, 20, 3, 10, 10) println("$x\t$y") random_gens = Dict(:pickup => [:notRandom, y/t0]) -- GitLab