Skip to content

Commit

Permalink
Finished implementing trials; new results
Browse files Browse the repository at this point in the history
Other minor last minute changes as well
  • Loading branch information
jah12014 committed Apr 21, 2018
1 parent ab5fbf5 commit b3fb03c
Show file tree
Hide file tree
Showing 29 changed files with 14,202 additions and 12,280 deletions.
Binary file modified IncrementalMinimization/results/budget_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,280 changes: 2,147 additions & 2,133 deletions IncrementalMinimization/results/budget_test.txt

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed IncrementalMinimization/results/compare_graph_1.png
Binary file not shown.
Binary file removed IncrementalMinimization/results/compare_graph_2.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,145 changes: 0 additions & 2,145 deletions IncrementalMinimization/results/compare_test_dependency.txt

This file was deleted.

Binary file not shown.
165 changes: 165 additions & 0 deletions IncrementalMinimization/results/dependency_record_test.txt

Large diffs are not rendered by default.

1,592 changes: 1,592 additions & 0 deletions IncrementalMinimization/results/depth_test.txt

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
165 changes: 165 additions & 0 deletions IncrementalMinimization/results/naive_record_test.txt

Large diffs are not rendered by default.

7,709 changes: 7,709 additions & 0 deletions IncrementalMinimization/results/powerEN_compare_test.txt

Large diffs are not rendered by default.

Binary file removed IncrementalMinimization/results/powerEN_graph.png
Binary file not shown.
7,709 changes: 0 additions & 7,709 deletions IncrementalMinimization/results/powerEN_test.txt

This file was deleted.

2,115 changes: 2,115 additions & 0 deletions IncrementalMinimization/results/regexlib_compare_test.txt

Large diffs are not rendered by default.

164 changes: 0 additions & 164 deletions IncrementalMinimization/results/second_record_test.txt

This file was deleted.

Binary file not shown.
165 changes: 165 additions & 0 deletions IncrementalMinimization/results/standard_record_test.txt

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions IncrementalMinimization/scripts/budget_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
xIndex = int(sys.argv[2])
percent1_index = int(sys.argv[3])
percent2_index = int(sys.argv[4])
#percent3_index = int(sys.argv[5]) #TODO: generalize to arbitrary number of indices
percent3_index = int(sys.argv[5]) #TODO: generalize to arbitrary number of indices
increment = int(sys.argv[6])
cutoff = int(sys.argv[7])

Expand Down Expand Up @@ -48,7 +48,7 @@ def get_tick_from_point(point):
break
p1 = data[row][percent1_index]
p2 = data[row][percent2_index]
#p3 = data[row][percent3_index]
p3 = data[row][percent3_index]
tick = ticks[cur_index]
actual_tick = get_tick_from_point(x)
while(tick != actual_tick):
Expand All @@ -60,12 +60,12 @@ def get_tick_from_point(point):
count = 1
p1_data.append(p1)
p2_data.append(p2)
#p3_data.append(p3)
p3_data.append(p3)
else:
count += 1
p1_data[cur_index] += (p1 - p1_data[cur_index])/float(count)
p2_data[cur_index] += (p2 - p2_data[cur_index])/float(count)
#p3_data[cur_index] += (p3 - p3_data[cur_index])/float(count)
p3_data[cur_index] += (p3 - p3_data[cur_index])/float(count)
assert(len(ticks) == len(p1_data))
assert(len(p1_data) == len(p2_data))
return ticks, p1_data, p2_data, p3_data
Expand All @@ -81,12 +81,12 @@ def get_tick_from_point(point):

p1_data = [p1*100 for p1 in p1_data]
p2_data = [p2*100 for p2 in p2_data]
#p3_data = [p3*100 for p3 in p3_data]
p3_data = [p3*100 for p3 in p3_data]
fig, ax = pyplot.subplots(1,1)
percent_format = mtick.FormatStrFormatter("%.0f%%")
ax.bar([a - 0.15 for a in range(0,len(p1_data))], p1_data, width=0.20, label="Symbolic Incremental")
ax.bar([b + 0.15 for b in range(0,len(p2_data))], p2_data, width=0.20, label="'Naive' Incremental")
#ax.bar([c + 0.20 for c in range(0,len(p3_data))], p3_data, width=0.20, label ="Incremental with Dependency Check")
ax.bar([a - 0.20 for a in range(0,len(p1_data))], p1_data, width=0.20, label="Efficient Incremental")
ax.bar([b + 0.0 for b in range(0,len(p2_data))], p2_data, width=0.20, label="Naive Incremental")
ax.bar([c + 0.20 for c in range(0,len(p3_data))], p3_data, width=0.20, label ="Incremental with Dependency Check")
pyplot.xticks(range(0, len(ticks)), ticks, fontsize=6)
ax.yaxis.set_major_formatter(percent_format)
pyplot.xlabel(xAxis)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

xAxis = "Number of States"
yAxis = "Average Minimization Time (ms)"
title = "Comparison of SFA Minimization Algorithms"
title = "Comparison of Incremental SFA Minimization Algorithms"
scale = "log"

testsfile = sys.argv[1]
Expand Down Expand Up @@ -49,12 +49,17 @@ def mergeData(data, index):

fData = mergeData(fData, xIndex)

lineStyles = ['-','--','-.',':'] #Different line style markers

xData = [row[xIndex] for row in fData if row[xIndex] <= cutoff]
style_num = 0
for i in graph_indices:
assert(style_num < len(lineStyles))
graphData = [row[i] for row in fData[:len(xData)]]
pyplot.plot(xData, graphData, label=title_row[i], linewidth=1.0)
pyplot.plot(xData, graphData, label=title_row[i], linestyle=lineStyles[style_num], linewidth=1.0)
style_num += 1
pyplot.yscale(scale)
pyplot.legend(loc=0)
pyplot.legend(loc=4)
pyplot.xlabel(xAxis)
pyplot.ylabel(yAxis)
pyplot.title(title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ else if(!pNextClass.equals(qNextClass))
{
neq.add(pathPair); //TODO: remove this call from outer minimize method
}
deps.mergeStates(equivClasses, newPath);
int result = deps.mergeStates(equivClasses, newPath);
if(result > 0)
{
System.out.println(String.format("Non-recursive alg merged %d pairs", result));
}
this.path.clear();
return false;
}
Expand Down
19 changes: 10 additions & 9 deletions IncrementalMinimization/src/structures/DependencyGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ public void addAllDependencies(List<Integer> pair, ArrayList<List<Integer>> dpai
}
}

private int mergePair(StatePair pairEntry, DisjointSets<Integer> equivClasses, HashSet<List<Integer>> badPath) throws TimeoutException
private int mergePair(StatePair pairEntry, DisjointSets<Integer> equivClasses,
HashSet<List<Integer>> badPairs) throws TimeoutException
{

Queue<StatePair> depQueue = new LinkedList<StatePair>();
Expand All @@ -143,23 +144,23 @@ private int mergePair(StatePair pairEntry, DisjointSets<Integer> equivClasses, H
while(!depQueue.isEmpty())
{
StatePair dep = depQueue.remove();
if(seenPairs.contains(dep))
if(seenPairs.contains(dep) ||
equivClasses.find(dep.pair.get(0)) == equivClasses.find(dep.pair.get(1)))
{
continue;
}
seenPairs.add(dep);
if(!dep.isTested())
{
return 0;
}
if(badPath.contains(dep.pair))
if(!dep.isTested() || badPairs.contains(dep.pair))
{
return 0;
}
depQueue.addAll(dep.getDependencies());
}
equivClasses.union(pairEntry.pair.get(0), pairEntry.pair.get(1));
return 1;
for(StatePair mergePair : seenPairs)
{
equivClasses.union(mergePair.pair.get(0), mergePair.pair.get(1));
}
return seenPairs.size();
}

public int mergeStates(DisjointSets<Integer> equivClasses, HashSet<List<Integer>> badPath) throws TimeoutException
Expand Down
Loading

0 comments on commit b3fb03c

Please sign in to comment.