Skip to content

Commit 7cbb8f9

Browse files
committed
Graph.py and PyInterpreter.java added
1 parent 1de1e96 commit 7cbb8f9

18 files changed

+138
-0
lines changed

.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>org.example</groupId>
8+
<artifactId>CreationalPatternsBenchmarkTesting</artifactId>
9+
<version>1.0</version>
10+
<build>
11+
<plugins>
12+
<plugin>
13+
<groupId>org.apache.maven.plugins</groupId>
14+
<artifactId>maven-jar-plugin</artifactId>
15+
<configuration>
16+
<finalName>Project</finalName>
17+
<archive>
18+
<manifest>
19+
<mainClass>App</mainClass>
20+
</manifest>
21+
</archive>
22+
</configuration>
23+
</plugin>
24+
</plugins>
25+
</build>
26+
27+
<properties>
28+
<maven.compiler.source>16</maven.compiler.source>
29+
<maven.compiler.target>16</maven.compiler.target>
30+
</properties>
31+
32+
</project>

App.java src/main/java/App.java

File renamed without changes.
File renamed without changes.
File renamed without changes.

src/main/resources/Graph.py

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import pandas as pd
2+
import numpy as np
3+
import seaborn as sbn
4+
import matplotlib.pyplot as plt
5+
6+
d1 = pd.read_csv("Builder.csv", encoding='utf-8', sep=',', header=None, names=["Pattern", "Time"])
7+
8+
d2 = pd.read_csv("Abstract_Factory.csv", encoding='utf-8', sep=',', header=None, names=["Pattern", "Time"])
9+
10+
d3 = pd.read_csv("Simple_Factory.csv", encoding='utf-8', sep=',', header=None, names=["Pattern", "Time"])
11+
12+
d4 = pd.read_csv("Prototype.csv", encoding='utf-8', sep=',', header=None, names=["Pattern", "Time"])
13+
14+
d5 = pd.read_csv("NonePattern.csv", encoding='utf-8', sep=',', header=None, names=["Pattern", "Time"])
15+
16+
Total1=d1['Time'].sum()
17+
18+
Total2 = d2['Time'].sum()
19+
20+
Total3 = d3['Time'].sum()
21+
22+
Total4 = d4['Time'].sum()
23+
24+
Total5 = d5['Time'].sum()
25+
26+
X = ['Builder','Abstract_Factory','Simple_Factory','Prototype']
27+
Times = [Total1,Total2,Total3,Total4]
28+
NonePattern = [Total5]
29+
plt.figure(figsize=(10,6))
30+
X_axis = np.arange(len(X))
31+
32+
plt.bar(X_axis - 0.2, Times, 0.4, label = 'Valid Pattern')
33+
plt.bar(X_axis + 0.2, NonePattern, 0.4, label = 'None Pattern')
34+
35+
plt.xticks(X_axis, X)
36+
plt.xlabel("Comparison of Patterns")
37+
plt.ylabel("1.000.000 Objects Production Time")
38+
plt.title("")
39+
plt.legend()
40+
plt.savefig("!!_ALLLLLLL_!!.png",dpi=300)
41+
plt.show()

0 commit comments

Comments
 (0)