Commit c58b21d5 authored by Johannes Mey's avatar Johannes Mey
Browse files

improve plot and add adequate scenarios

parent 3e7fa442
...@@ -7,7 +7,7 @@ from matplotlib import colors as mcolors ...@@ -7,7 +7,7 @@ from matplotlib import colors as mcolors
# constants # constants
bar_width = 0.2 bar_width = 0.2
solver_names = ['ilp-direct', 'simple'] solver_names = ['ilp-direct', 'ilp-external', 'random', 'simple']
patterns = ['❌', '✔'] patterns = ['❌', '✔']
colors = [c[4:] for c in (sorted(mcolors.TABLEAU_COLORS.keys())) if 'dark' + c[4:] in mcolors.CSS4_COLORS] colors = [c[4:] for c in (sorted(mcolors.TABLEAU_COLORS.keys())) if 'dark' + c[4:] in mcolors.CSS4_COLORS]
...@@ -27,6 +27,11 @@ def load(name, show_head=False): ...@@ -27,6 +27,11 @@ def load(name, show_head=False):
data['tool'] = data.name.astype(str) data['tool'] = data.name.astype(str)
data['Gen'] = (data.Gen.astype(int) > 0) * data.Gen.astype(int) data['Gen'] = (data.Gen.astype(int) > 0) * data.Gen.astype(int)
data['total'] = data.Gen.astype(int) + data.Solved.astype(int) data['total'] = data.Gen.astype(int) + data.Solved.astype(int)
m = data.groupby(['name'])[['total']].apply(np.median)
m.name = 'MEDIAN'
data = data.join(m, on=['name'])
data = data.drop_duplicates(subset='tool')
data = data[data.tool.isin(solver_names)]
if show_head: if show_head:
data.head() data.head()
return data return data
...@@ -47,13 +52,18 @@ def plot_range(names, labels, ax): ...@@ -47,13 +52,18 @@ def plot_range(names, labels, ax):
labelpos = [] labelpos = []
for i in range(len(names)): for i in range(len(names)):
labelpos += [(0.5 + i * (N + 0.5)) * width] labelpos += [(N/2 - 0.5 + i * (N + 0.5)) * width]
for (name, i) in zip(names, range(len(names))): for (name, i) in zip(names, range(len(names))):
# load data # load data
data = load_scenario_file(name) data = load_scenario_file(name)
means = data.total
print(data)
means = data.MEDIAN
rect = ax.bar((ind + i * (N + 0.5)) * width, means, width=width, color=colors) rect = ax.bar((ind + i * (N + 0.5)) * width, means, width=width, color=colors)
for r, isValid, color in zip(rect, data.Valid, colors): for r, isValid, color in zip(rect, data.Valid, colors):
...@@ -70,6 +80,7 @@ def plot_range(names, labels, ax): ...@@ -70,6 +80,7 @@ def plot_range(names, labels, ax):
ax.set_xticks(labelpos) ax.set_xticks(labelpos)
ax.set_xticklabels(labels) ax.set_xticklabels(labels)
ax.set_ylim([1, 6000000])
ax.set_yticks([1, 1000, 1000000]) ax.set_yticks([1, 1000, 1000000])
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
"path": "results", "path": "results",
"logLevel": "info", "logLevel": "info",
"solvers": [ "solvers": [
"aco", // "aco",
"emfer", // "emfer",
"ilp-direct", "ilp-direct",
"ilp-external", "ilp-external",
"random", "random",
"genetic", "genetic",
"simple" "simple"
], ],
"timeoutValue": 2, "timeoutValue": 5,
"timeoutUnit": "MINUTES", "timeoutUnit": "MINUTES",
"seed": 0, "seed": 0,
"sandBoxed": true, "sandBoxed": true,
// "repetitions": 10, "repetitions": 3,
"scenarios": [ "scenarios": [
// { "id": 0, "name": "size0", "variants": 1, "requests": 1, "depth": 1, "resources": 1 }, // { "id": 0, "name": "size0", "variants": 1, "requests": 1, "depth": 1, "resources": 1 },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment