Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Ridepooling_Simulations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rhaag
Ridepooling_Simulations
Commits
16d4c644
Commit
16d4c644
authored
3 years ago
by
Ruben Haag
Browse files
Options
Downloads
Patches
Plain Diff
Results after first run
parent
821e845a
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
initialize.jl
+3
-4
3 additions, 4 deletions
initialize.jl
put_together.jl
+14
-8
14 additions, 8 deletions
put_together.jl
results.csv
+1601
-0
1601 additions, 0 deletions
results.csv
sim.jl
+1
-1
1 addition, 1 deletion
sim.jl
with
1619 additions
and
13 deletions
initialize.jl
+
3
−
4
View file @
16d4c644
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
put_together.jl
+
14
−
8
View file @
16d4c644
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]),
...
...
This diff is collapsed.
Click to expand it.
results.csv
0 → 100644
+
1601
−
0
View file @
16d4c644
This diff is collapsed.
Click to expand it.
sim.jl
+
1
−
1
View file @
16d4c644
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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment