Skip to content
Snippets Groups Projects
Commit c58b21d5 authored by Johannes Mey's avatar Johannes Mey
Browse files

improve plot and add adequate scenarios

parent 3e7fa442
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ from matplotlib import colors as mcolors
# constants
bar_width = 0.2
solver_names = ['ilp-direct', 'simple']
solver_names = ['ilp-direct', 'ilp-external', 'random', 'simple']
patterns = ['', '']
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):
data['tool'] = data.name.astype(str)
data['Gen'] = (data.Gen.astype(int) > 0) * data.Gen.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:
data.head()
return data
......@@ -47,13 +52,18 @@ def plot_range(names, labels, ax):
labelpos = []
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))):
# load data
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)
for r, isValid, color in zip(rect, data.Valid, colors):
......@@ -70,6 +80,7 @@ def plot_range(names, labels, ax):
ax.set_xticks(labelpos)
ax.set_xticklabels(labels)
ax.set_ylim([1, 6000000])
ax.set_yticks([1, 1000, 1000000])
......
......@@ -2,19 +2,19 @@
"path": "results",
"logLevel": "info",
"solvers": [
"aco",
"emfer",
// "aco",
// "emfer",
"ilp-direct",
"ilp-external",
"random",
"genetic",
"simple"
],
"timeoutValue": 2,
"timeoutValue": 5,
"timeoutUnit": "MINUTES",
"seed": 0,
"sandBoxed": true,
// "repetitions": 10,
"repetitions": 3,
"scenarios": [
// { "id": 0, "name": "size0", "variants": 1, "requests": 1, "depth": 1, "resources": 1 },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment