Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ba
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
markn92
ba
Commits
dbbd88d1
Commit
dbbd88d1
authored
4 years ago
by
markn92
Browse files
Options
Downloads
Patches
Plain Diff
minor
parent
67553cc1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
evaluation/lib/benchmarks.py
+12
-16
12 additions, 16 deletions
evaluation/lib/benchmarks.py
evaluation/lib/queries.py
+0
-6
0 additions, 6 deletions
evaluation/lib/queries.py
evaluation/run.py
+6
-1
6 additions, 1 deletion
evaluation/run.py
with
18 additions
and
23 deletions
evaluation/lib/benchmarks.py
+
12
−
16
View file @
dbbd88d1
...
@@ -139,6 +139,9 @@ def init(graphs, charging_stations, conf, result_dir):
...
@@ -139,6 +139,9 @@ def init(graphs, charging_stations, conf, result_dir):
])
])
for
map_name
,
G
in
zip
(
conf
[
'
maps
'
],
graphs
):
for
map_name
,
G
in
zip
(
conf
[
'
maps
'
],
graphs
):
nodes
=
random
.
sample
(
list
(
G
.
nodes
),
k
=
2
*
conf
[
'
queries_per_setup
'
])
start_nodes
=
nodes
[:
int
(
len
(
nodes
)
/
2
)]
target_nodes
=
nodes
[
int
(
len
(
nodes
)
/
2
):]
for
setup
in
conf
[
'
setups
'
]:
for
setup
in
conf
[
'
setups
'
]:
# Random adding of charging stations
# Random adding of charging stations
...
@@ -149,22 +152,15 @@ def init(graphs, charging_stations, conf, result_dir):
...
@@ -149,22 +152,15 @@ def init(graphs, charging_stations, conf, result_dir):
with
result_dir
.
joinpath
(
filename
).
open
(
'
a
'
)
as
f
:
with
result_dir
.
joinpath
(
filename
).
open
(
'
a
'
)
as
f
:
write_row
(
f
,
result_data
)
write_row
(
f
,
result_data
)
# little hacky: get just created state graph from module cache
# random start and target nodes of state graph
state_graph
,
_
=
queries
.
CACHE
[
queries
.
_cache_state_graph_key
]
_run_queries
(
if
len
(
state_graph
.
nodes
)
>
2
:
G
,
# random start and target nodes of state graph
start_nodes
,
nodes
=
random
.
sample
(
list
(
state_graph
.
nodes
),
k
=
2
*
conf
[
'
queries_per_setup
'
])
target_nodes
,
start_nodes
=
nodes
[:
int
(
len
(
nodes
)
/
2
)]
setup
,
target_nodes
=
nodes
[
int
(
len
(
nodes
)
/
2
):]
[
queries
.
insert_nodes_into_state_graph
],
result_dir
_run_queries
(
)
G
,
start_nodes
,
target_nodes
,
setup
,
[
queries
.
insert_nodes_into_state_graph
],
result_dir
)
# Delete cached graphs
# Delete cached graphs
for
key
in
list
(
queries
.
CACHE
.
keys
()):
for
key
in
list
(
queries
.
CACHE
.
keys
()):
...
...
This diff is collapsed.
Click to expand it.
evaluation/lib/queries.py
+
0
−
6
View file @
dbbd88d1
...
@@ -159,12 +159,6 @@ def init_gasstation_queries(graph, conf):
...
@@ -159,12 +159,6 @@ def init_gasstation_queries(graph, conf):
contracted_graph
,
contraction_time
=
get_contracted_graph
(
graph
,
conf
,
f
)
contracted_graph
,
contraction_time
=
get_contracted_graph
(
graph
,
conf
,
f
)
state_graph
,
state_graph_time
=
get_state_graph
(
contracted_graph
,
conf
,
f
)
state_graph
,
state_graph_time
=
get_state_graph
(
contracted_graph
,
conf
,
f
)
"""
start = perf_counter()
nx.shortest_path(state_graph, s, t)
runtime = perf_counter() - start
"""
return
InitQueryRow
(
return
InitQueryRow
(
charging_stations
=
len
(
graph
.
charging_stations
),
charging_stations
=
len
(
graph
.
charging_stations
),
time_contracted_graph
=
contraction_time
,
time_contracted_graph
=
contraction_time
,
...
...
This diff is collapsed.
Click to expand it.
evaluation/run.py
+
6
−
1
View file @
dbbd88d1
...
@@ -63,12 +63,17 @@ if __name__ == '__main__':
...
@@ -63,12 +63,17 @@ if __name__ == '__main__':
nargs
=
'
+
'
nargs
=
'
+
'
)
)
r
=
base
.
joinpath
(
'
results
'
)
r
.
mkdir
(
exist_ok
=
True
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
path
:
Path
path
:
Path
for
path
in
args
.
configs
:
for
path
in
args
.
configs
:
benchmark_dir
=
base
.
joinpath
(
'
results
'
,
path
.
with_suffix
(
''
))
benchmark_dir
=
r
.
joinpath
(
path
.
with_suffix
(
''
))
benchmark_dir
.
mkdir
(
exist_ok
=
True
)
benchmark_dir
.
mkdir
(
exist_ok
=
True
)
logging
.
info
(
f
'
Processing
{
path
}
..
'
)
path
=
path
.
with_suffix
(
'
.yaml
'
)
path
=
path
.
with_suffix
(
'
.yaml
'
)
with
base
.
joinpath
(
'
configs/
'
,
path
).
open
()
as
f
:
with
base
.
joinpath
(
'
configs/
'
,
path
).
open
()
as
f
:
...
...
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