From 057cfd433b5a6868fa66e7edffe7b1ecda2ee8eb Mon Sep 17 00:00:00 2001
From: "niehues.mark@gmail.com" <niehues.mark@gmail.com>
Date: Thu, 7 May 2020 13:49:37 +0200
Subject: [PATCH] make dir for every run

---
 evaluation/configs/example_rank.yaml | 4 ++--
 evaluation/lib/benchmarks.py         | 3 +--
 evaluation/run.py                    | 3 +++
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/evaluation/configs/example_rank.yaml b/evaluation/configs/example_rank.yaml
index 5152de8..4a47df8 100644
--- a/evaluation/configs/example_rank.yaml
+++ b/evaluation/configs/example_rank.yaml
@@ -5,8 +5,8 @@ type: rank
 charging_stations: charging_stations.json
 maps:
   - medium_nurnberg.osm
-queries_per_rank: 10
-ranks: [2, 4, 6, 8]
+queries_per_rank: 20
+ranks: [2, 4, 6, 8, 10, 12, 14]
 setups:
   - mu_s: 40 # Start and Target Soc
     mu_t: 0
diff --git a/evaluation/lib/benchmarks.py b/evaluation/lib/benchmarks.py
index 6ff017a..2b999f9 100644
--- a/evaluation/lib/benchmarks.py
+++ b/evaluation/lib/benchmarks.py
@@ -81,9 +81,8 @@ def _get_target_with_rank(graph, start_node, rank):
 def query(graphs, charging_stations, conf, result_dir):
     _init_result_files(result_dir)
     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']:
+            nodes = random.sample(list(G.nodes), k=2 * conf['queries_per_setup'])
             # Random start and target nodes
             start_nodes = nodes[:int(len(nodes) / 2)]
             target_nodes = nodes[int(len(nodes) / 2):]
diff --git a/evaluation/run.py b/evaluation/run.py
index bc8ea46..ce244f3 100644
--- a/evaluation/run.py
+++ b/evaluation/run.py
@@ -1,5 +1,6 @@
 import argparse
 import pickle
+import datetime
 import json
 import logging
 from time import perf_counter
@@ -66,6 +67,8 @@ if __name__ == '__main__':
 
     r = base.joinpath('results')
     r.mkdir(exist_ok=True)
+    r = r.joinpath(datetime.datetime.now().isoformat())
+    r.mkdir()
 
     args = parser.parse_args()
     path: Path
-- 
GitLab