]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/commitdiff
Use numbers as x ticks
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 23 Mar 2020 11:08:38 +0000 (12:08 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 23 Mar 2020 11:09:59 +0000 (12:09 +0100)
scripts/scenario.py

index 8076304ee8e056e9629322ab364dd13f073e54ea..048f1f0cf64e63c7f08e876db3d147de307c40e9 100644 (file)
@@ -17,14 +17,6 @@ from json import loads
 from os import listdir
 
 DNAME = "out"
-PNAMES = {
-    "test22": "3D tree, RS-RS",
-    "test23": "3D tree, RS-H",
-    "test24": "3D grid, RS-RS",
-    "test25": "3D grid, RS-H",
-    "test26": "2D tree, RS-E",
-    "test27": "2D grid, RS-E",
-}
 
 def sort_dict(f):
     """Sort dict returned by ``f``."""
@@ -112,38 +104,48 @@ def error_rate():
         dones = [1 for c in v if c < 9999 and c > -1]
         e[k] = 100 * (len(v) - len(dones)) / len(v)
     e2 = {}
+    i = 1
     for k, v in e.items():
-        e2[PNAMES[k]] = v
+        e2[i] = v
+        i += 1
     return [e2]
 
 def time():
     """Return the dictionary of ``fname``'s and corresponding times."""
     r = grep("time")
     r2 = {}
+    i = 1
     for k, v in r.items():
-        r2[PNAMES[k]] = v
+        r2[i] = v
+        i += 1
     return r2
 
 def cost():
     """Return the dictionary of ``fname``'s and corresponding costs."""
     r = grep("cost")
     r2 = {}
+    i = 1
     for k, v in r.items():
-        r2[PNAMES[k]] = v
+        r2[i] = v
+        i += 1
     return r2
 
 def cusp():
     """Return the dictionary of ``fname``'s and corresponding cusps."""
     r = grep("cusps-in-path")
     r2 = {}
+    i = 1
     for k, v in r.items():
-        r2[PNAMES[k]] = v
+        r2[i] = v
+        i += 1
     return r2
 
 def iter():
     """Return the dictionary of ``fname``'s and number of iterations."""
     r = grep("iterations")
     r2 = {}
+    i = 1
     for k, v in r.items():
-        r2[PNAMES[k]] = v
+        r2[i] = v
+        i += 1
     return r2