Skip to content
Snippets Groups Projects
Commit 057cfd43 authored by markn92's avatar markn92
Browse files

make dir for every run

parent 5810b574
No related branches found
No related tags found
No related merge requests found
...@@ -5,8 +5,8 @@ type: rank ...@@ -5,8 +5,8 @@ type: rank
charging_stations: charging_stations.json charging_stations: charging_stations.json
maps: maps:
- medium_nurnberg.osm - medium_nurnberg.osm
queries_per_rank: 10 queries_per_rank: 20
ranks: [2, 4, 6, 8] ranks: [2, 4, 6, 8, 10, 12, 14]
setups: setups:
- mu_s: 40 # Start and Target Soc - mu_s: 40 # Start and Target Soc
mu_t: 0 mu_t: 0
......
...@@ -81,9 +81,8 @@ def _get_target_with_rank(graph, start_node, rank): ...@@ -81,9 +81,8 @@ def _get_target_with_rank(graph, start_node, rank):
def query(graphs, charging_stations, conf, result_dir): def query(graphs, charging_stations, conf, result_dir):
_init_result_files(result_dir) _init_result_files(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'])
for setup in conf['setups']: for setup in conf['setups']:
nodes = random.sample(list(G.nodes), k=2 * conf['queries_per_setup'])
# Random start and target nodes # Random start and target nodes
start_nodes = nodes[:int(len(nodes) / 2)] start_nodes = nodes[:int(len(nodes) / 2)]
target_nodes = nodes[int(len(nodes) / 2):] target_nodes = nodes[int(len(nodes) / 2):]
......
import argparse import argparse
import pickle import pickle
import datetime
import json import json
import logging import logging
from time import perf_counter from time import perf_counter
...@@ -66,6 +67,8 @@ if __name__ == '__main__': ...@@ -66,6 +67,8 @@ if __name__ == '__main__':
r = base.joinpath('results') r = base.joinpath('results')
r.mkdir(exist_ok=True) r.mkdir(exist_ok=True)
r = r.joinpath(datetime.datetime.now().isoformat())
r.mkdir()
args = parser.parse_args() args = parser.parse_args()
path: Path path: Path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment