diff options
Diffstat (limited to 'Metrics')
47 files changed, 2823 insertions, 0 deletions
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/.classpath b/Metrics/Metrics-Calculation/SocialNetwork_plugin/.classpath new file mode 100644 index 00000000..58c238b9 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/.classpath | |||
@@ -0,0 +1,10 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <classpath> | ||
3 | <classpathentry kind="src" path="encore_gen"/> | ||
4 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
5 | <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
6 | <classpathentry kind="src" path="src"/> | ||
7 | <classpathentry kind="src" path="model"/> | ||
8 | <classpathentry kind="src" path="src-gen"/> | ||
9 | <classpathentry kind="output" path="bin"/> | ||
10 | </classpath> | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/.project b/Metrics/Metrics-Calculation/SocialNetwork_plugin/.project new file mode 100644 index 00000000..decac49c --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/.project | |||
@@ -0,0 +1,40 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <projectDescription> | ||
3 | <name>SocialNetwork_plugin</name> | ||
4 | <comment></comment> | ||
5 | <projects> | ||
6 | </projects> | ||
7 | <buildSpec> | ||
8 | <buildCommand> | ||
9 | <name>org.eclipse.viatra.query.tooling.ui.projectbuilder</name> | ||
10 | <arguments> | ||
11 | </arguments> | ||
12 | </buildCommand> | ||
13 | <buildCommand> | ||
14 | <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> | ||
15 | <arguments> | ||
16 | </arguments> | ||
17 | </buildCommand> | ||
18 | <buildCommand> | ||
19 | <name>org.eclipse.jdt.core.javabuilder</name> | ||
20 | <arguments> | ||
21 | </arguments> | ||
22 | </buildCommand> | ||
23 | <buildCommand> | ||
24 | <name>org.eclipse.pde.ManifestBuilder</name> | ||
25 | <arguments> | ||
26 | </arguments> | ||
27 | </buildCommand> | ||
28 | <buildCommand> | ||
29 | <name>org.eclipse.pde.SchemaBuilder</name> | ||
30 | <arguments> | ||
31 | </arguments> | ||
32 | </buildCommand> | ||
33 | </buildSpec> | ||
34 | <natures> | ||
35 | <nature>org.eclipse.pde.PluginNature</nature> | ||
36 | <nature>org.eclipse.jdt.core.javanature</nature> | ||
37 | <nature>org.eclipse.viatra.query.projectnature</nature> | ||
38 | <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | ||
39 | </natures> | ||
40 | </projectDescription> | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/.settings/org.eclipse.jdt.core.prefs b/Metrics/Metrics-Calculation/SocialNetwork_plugin/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..0c68a61d --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/.settings/org.eclipse.jdt.core.prefs | |||
@@ -0,0 +1,7 @@ | |||
1 | eclipse.preferences.version=1 | ||
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
4 | org.eclipse.jdt.core.compiler.compliance=1.8 | ||
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
7 | org.eclipse.jdt.core.compiler.source=1.8 | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/1.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/1.csv new file mode 100644 index 00000000..b7f73ed2 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/1.csv | |||
@@ -0,0 +1 @@ | |||
Time,0 : 0.0 | |||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/META-INF/MANIFEST.MF b/Metrics/Metrics-Calculation/SocialNetwork_plugin/META-INF/MANIFEST.MF new file mode 100644 index 00000000..b7ec683a --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/META-INF/MANIFEST.MF | |||
@@ -0,0 +1,30 @@ | |||
1 | Manifest-Version: 1.0 | ||
2 | Bundle-ManifestVersion: 2 | ||
3 | Bundle-Name: %pluginName | ||
4 | Bundle-SymbolicName: SocialNetwork_plugin;singleton:=true | ||
5 | Bundle-Version: 1.0.0.qualifier | ||
6 | Bundle-ClassPath: . | ||
7 | Bundle-Vendor: %providerName | ||
8 | Bundle-Localization: plugin | ||
9 | Export-Package: ca.mcgill.ecse.socialnetwork.plugin, | ||
10 | socialnetwork, | ||
11 | socialnetwork.impl, | ||
12 | socialnetwork.util | ||
13 | Require-Bundle: org.eclipse.viatra.query.runtime.rete, | ||
14 | org.eclipse.viatra.query.runtime.localsearch, | ||
15 | org.eclipse.xtext.xbase.lib, | ||
16 | org.eclipse.viatra.query.runtime, | ||
17 | org.eclipse.core.runtime, | ||
18 | org.eclipse.emf.ecore;visibility:=reexport, | ||
19 | org.eclipse.emf.ecore.xmi;bundle-version="2.15.0", | ||
20 | hu.bme.mit.inf.dslreasoner.application;bundle-version="1.0.0", | ||
21 | org.junit;bundle-version="4.12.0", | ||
22 | org.eclipse.collections;bundle-version="9.2.0", | ||
23 | hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph;bundle-version="1.0.0", | ||
24 | ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator;bundle-version="1.0.0", | ||
25 | hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.validation;bundle-version="0.0.1" | ||
26 | Import-Package: org.apache.log4j, | ||
27 | org.junit;version="4.12.0" | ||
28 | Automatic-Module-Name: SocialNetwork_plugin | ||
29 | Bundle-ActivationPolicy: lazy | ||
30 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/SocialNetworkGeneration.vsconfig b/Metrics/Metrics-Calculation/SocialNetwork_plugin/SocialNetworkGeneration.vsconfig new file mode 100644 index 00000000..e051c659 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/SocialNetworkGeneration.vsconfig | |||
@@ -0,0 +1,24 @@ | |||
1 | import epackage "model/socialnetwork.ecore" | ||
2 | import viatra "src/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql" | ||
3 | |||
4 | generate { | ||
5 | metamodel = { package socialnetwork } | ||
6 | //constraints = { package ca.mcgill.ecse.socialnetwork.plugin } | ||
7 | partial-model = { "inputs/280nodes.xmi"} | ||
8 | |||
9 | solver = ViatraSolver | ||
10 | |||
11 | scope = { | ||
12 | #node = 301 | ||
13 | } | ||
14 | |||
15 | number = 1 | ||
16 | runs = 1 | ||
17 | config = { | ||
18 | log-level = normal | ||
19 | } | ||
20 | |||
21 | debug = "output/debug" | ||
22 | output = "output" | ||
23 | log = "output/log.txt" | ||
24 | } \ No newline at end of file | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/.gitignore new file mode 100644 index 00000000..67ee5625 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/.gitignore | |||
@@ -0,0 +1,6 @@ | |||
1 | /ca/ | ||
2 | /socialnetwork.aird | ||
3 | /socialnetwork.ecore | ||
4 | /socialnetwork.genmodel | ||
5 | /socialnetwork/ | ||
6 | /statistics/ | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/build.properties b/Metrics/Metrics-Calculation/SocialNetwork_plugin/build.properties new file mode 100644 index 00000000..63ef0274 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/build.properties | |||
@@ -0,0 +1,9 @@ | |||
1 | bin.includes = .,\ | ||
2 | model/,\ | ||
3 | META-INF/,\ | ||
4 | plugin.xml,\ | ||
5 | plugin.properties | ||
6 | jars.compile.order = . | ||
7 | source.. = encore_gen/,\ | ||
8 | src-gen/ | ||
9 | output.. = bin/ | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakinduum/mpc_rep.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakinduum/mpc_rep.csv new file mode 100644 index 00000000..fc39ac54 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakinduum/mpc_rep.csv | |||
@@ -0,0 +1,9 @@ | |||
1 | Meta Mode,yakindumm | ||
2 | Number of Edge types,6 | ||
3 | Number Of Nodes,67 | ||
4 | OutDegreeValue,1,2,3,4,6,8,9 | ||
5 | OutDegreeCount,4,45,9,1,1,2,5 | ||
6 | NAValue,1,2,3,4,5,6 | ||
7 | NACount,1,3,4,42,15,2 | ||
8 | MPCValue,0.00000,0.21600,0.45000,0.76800,0.80000,0.89751,0.90000,0.91349,0.92410,0.93061,0.93728,0.96000,0.97500,1.00000 | ||
9 | MPCCount,1,2,1,1,3,1,42,2,2,7,1,2,1,1 | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakinduum/na_rep.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakinduum/na_rep.csv new file mode 100644 index 00000000..43d411e4 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakinduum/na_rep.csv | |||
@@ -0,0 +1,9 @@ | |||
1 | Meta Mode,yakindumm | ||
2 | Number of Edge types,6 | ||
3 | Number Of Nodes,98 | ||
4 | OutDegreeValue,1,2,3,4,5,6,10,15 | ||
5 | OutDegreeCount,7,61,17,2,3,2,5,1 | ||
6 | NAValue,1,2,3,4,5,6 | ||
7 | NACount,1,4,6,62,23,2 | ||
8 | MPCValue,0.00000,0.14062,0.19835,0.38400,0.45000,0.80000,0.86667,0.90000,0.90888,0.91429,0.93061,0.93223,0.94815,0.98400,1.00000 | ||
9 | MPCCount,1,1,1,1,1,6,1,61,2,4,14,2,1,1,1 | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakinduum/out_d_rep.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakinduum/out_d_rep.csv new file mode 100644 index 00000000..17965018 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakinduum/out_d_rep.csv | |||
@@ -0,0 +1,9 @@ | |||
1 | Meta Mode,yakindumm | ||
2 | Number of Edge types,6 | ||
3 | Number Of Nodes,88 | ||
4 | OutDegreeValue,1,2,3,4,5,6,8,10,11,13 | ||
5 | OutDegreeCount,6,57,12,3,1,2,2,3,1,1 | ||
6 | NAValue,1,2,3,4,5,6 | ||
7 | NACount,1,3,6,56,20,2 | ||
8 | MPCValue,0.00000,0.15918,0.18333,0.38400,0.76800,0.80000,0.88889,0.90000,0.90888,0.91349,0.91429,0.93061,0.93223,0.93728,1.00000 | ||
9 | MPCCount,1,1,1,1,1,5,2,56,1,2,3,10,1,1,2 | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/debug/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/debug/.gitignore new file mode 100644 index 00000000..17126b28 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/debug/.gitignore | |||
@@ -0,0 +1,4 @@ | |||
1 | # ignore everything in this folder except for this folder it self | ||
2 | |||
3 | * | ||
4 | !.gitignore \ No newline at end of file | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/Person.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/Person.java new file mode 100644 index 00000000..b1e0a041 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/Person.java | |||
@@ -0,0 +1,62 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * A representation of the model object '<em><b>Person</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * <p> | ||
15 | * The following features are supported: | ||
16 | * </p> | ||
17 | * <ul> | ||
18 | * <li>{@link socialnetwork.Person#getFriends <em>Friends</em>}</li> | ||
19 | * <li>{@link socialnetwork.Person#getName <em>Name</em>}</li> | ||
20 | * </ul> | ||
21 | * | ||
22 | * @see socialnetwork.SocialnetworkPackage#getPerson() | ||
23 | * @model | ||
24 | * @generated | ||
25 | */ | ||
26 | public interface Person extends EObject { | ||
27 | /** | ||
28 | * Returns the value of the '<em><b>Friends</b></em>' reference list. | ||
29 | * The list contents are of type {@link socialnetwork.Person}. | ||
30 | * <!-- begin-user-doc --> | ||
31 | * <!-- end-user-doc --> | ||
32 | * @return the value of the '<em>Friends</em>' reference list. | ||
33 | * @see socialnetwork.SocialnetworkPackage#getPerson_Friends() | ||
34 | * @model | ||
35 | * @generated | ||
36 | */ | ||
37 | EList<Person> getFriends(); | ||
38 | |||
39 | /** | ||
40 | * Returns the value of the '<em><b>Name</b></em>' attribute. | ||
41 | * The default value is <code>"Name"</code>. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @return the value of the '<em>Name</em>' attribute. | ||
45 | * @see #setName(String) | ||
46 | * @see socialnetwork.SocialnetworkPackage#getPerson_Name() | ||
47 | * @model default="Name" | ||
48 | * @generated | ||
49 | */ | ||
50 | String getName(); | ||
51 | |||
52 | /** | ||
53 | * Sets the value of the '{@link socialnetwork.Person#getName <em>Name</em>}' attribute. | ||
54 | * <!-- begin-user-doc --> | ||
55 | * <!-- end-user-doc --> | ||
56 | * @param value the new value of the '<em>Name</em>' attribute. | ||
57 | * @see #getName() | ||
58 | * @generated | ||
59 | */ | ||
60 | void setName(String value); | ||
61 | |||
62 | } // Person | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialNetwork.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialNetwork.java new file mode 100644 index 00000000..4653f6dd --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialNetwork.java | |||
@@ -0,0 +1,62 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * A representation of the model object '<em><b>Social Network</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * <p> | ||
15 | * The following features are supported: | ||
16 | * </p> | ||
17 | * <ul> | ||
18 | * <li>{@link socialnetwork.SocialNetwork#getName <em>Name</em>}</li> | ||
19 | * <li>{@link socialnetwork.SocialNetwork#getPersons <em>Persons</em>}</li> | ||
20 | * </ul> | ||
21 | * | ||
22 | * @see socialnetwork.SocialnetworkPackage#getSocialNetwork() | ||
23 | * @model | ||
24 | * @generated | ||
25 | */ | ||
26 | public interface SocialNetwork extends EObject { | ||
27 | /** | ||
28 | * Returns the value of the '<em><b>Name</b></em>' attribute. | ||
29 | * The default value is <code>"SocialNetwork"</code>. | ||
30 | * <!-- begin-user-doc --> | ||
31 | * <!-- end-user-doc --> | ||
32 | * @return the value of the '<em>Name</em>' attribute. | ||
33 | * @see #setName(String) | ||
34 | * @see socialnetwork.SocialnetworkPackage#getSocialNetwork_Name() | ||
35 | * @model default="SocialNetwork" | ||
36 | * @generated | ||
37 | */ | ||
38 | String getName(); | ||
39 | |||
40 | /** | ||
41 | * Sets the value of the '{@link socialnetwork.SocialNetwork#getName <em>Name</em>}' attribute. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @param value the new value of the '<em>Name</em>' attribute. | ||
45 | * @see #getName() | ||
46 | * @generated | ||
47 | */ | ||
48 | void setName(String value); | ||
49 | |||
50 | /** | ||
51 | * Returns the value of the '<em><b>Persons</b></em>' containment reference list. | ||
52 | * The list contents are of type {@link socialnetwork.Person}. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @return the value of the '<em>Persons</em>' containment reference list. | ||
56 | * @see socialnetwork.SocialnetworkPackage#getSocialNetwork_Persons() | ||
57 | * @model containment="true" | ||
58 | * @generated | ||
59 | */ | ||
60 | EList<Person> getPersons(); | ||
61 | |||
62 | } // SocialNetwork | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkFactory.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkFactory.java new file mode 100644 index 00000000..cf7a4250 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkFactory.java | |||
@@ -0,0 +1,51 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EFactory; | ||
6 | |||
7 | /** | ||
8 | * <!-- begin-user-doc --> | ||
9 | * The <b>Factory</b> for the model. | ||
10 | * It provides a create method for each non-abstract class of the model. | ||
11 | * <!-- end-user-doc --> | ||
12 | * @see socialnetwork.SocialnetworkPackage | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface SocialnetworkFactory extends EFactory { | ||
16 | /** | ||
17 | * The singleton instance of the factory. | ||
18 | * <!-- begin-user-doc --> | ||
19 | * <!-- end-user-doc --> | ||
20 | * @generated | ||
21 | */ | ||
22 | SocialnetworkFactory eINSTANCE = socialnetwork.impl.SocialnetworkFactoryImpl.init(); | ||
23 | |||
24 | /** | ||
25 | * Returns a new object of class '<em>Social Network</em>'. | ||
26 | * <!-- begin-user-doc --> | ||
27 | * <!-- end-user-doc --> | ||
28 | * @return a new object of class '<em>Social Network</em>'. | ||
29 | * @generated | ||
30 | */ | ||
31 | SocialNetwork createSocialNetwork(); | ||
32 | |||
33 | /** | ||
34 | * Returns a new object of class '<em>Person</em>'. | ||
35 | * <!-- begin-user-doc --> | ||
36 | * <!-- end-user-doc --> | ||
37 | * @return a new object of class '<em>Person</em>'. | ||
38 | * @generated | ||
39 | */ | ||
40 | Person createPerson(); | ||
41 | |||
42 | /** | ||
43 | * Returns the package supported by this factory. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @return the package supported by this factory. | ||
47 | * @generated | ||
48 | */ | ||
49 | SocialnetworkPackage getSocialnetworkPackage(); | ||
50 | |||
51 | } //SocialnetworkFactory | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkPackage.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkPackage.java new file mode 100644 index 00000000..f215f469 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkPackage.java | |||
@@ -0,0 +1,293 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EAttribute; | ||
6 | import org.eclipse.emf.ecore.EClass; | ||
7 | import org.eclipse.emf.ecore.EPackage; | ||
8 | import org.eclipse.emf.ecore.EReference; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * The <b>Package</b> for the model. | ||
13 | * It contains accessors for the meta objects to represent | ||
14 | * <ul> | ||
15 | * <li>each class,</li> | ||
16 | * <li>each feature of each class,</li> | ||
17 | * <li>each operation of each class,</li> | ||
18 | * <li>each enum,</li> | ||
19 | * <li>and each data type</li> | ||
20 | * </ul> | ||
21 | * <!-- end-user-doc --> | ||
22 | * @see socialnetwork.SocialnetworkFactory | ||
23 | * @model kind="package" | ||
24 | * annotation="http://www.eclipse.org/emf/2002/Ecore" | ||
25 | * @generated | ||
26 | */ | ||
27 | public interface SocialnetworkPackage extends EPackage { | ||
28 | /** | ||
29 | * The package name. | ||
30 | * <!-- begin-user-doc --> | ||
31 | * <!-- end-user-doc --> | ||
32 | * @generated | ||
33 | */ | ||
34 | String eNAME = "socialnetwork"; | ||
35 | |||
36 | /** | ||
37 | * The package namespace URI. | ||
38 | * <!-- begin-user-doc --> | ||
39 | * <!-- end-user-doc --> | ||
40 | * @generated | ||
41 | */ | ||
42 | String eNS_URI = "http://ecse.mcgill.ca/socialnetwork"; | ||
43 | |||
44 | /** | ||
45 | * The package namespace name. | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @generated | ||
49 | */ | ||
50 | String eNS_PREFIX = "socialnetwork"; | ||
51 | |||
52 | /** | ||
53 | * The singleton instance of the package. | ||
54 | * <!-- begin-user-doc --> | ||
55 | * <!-- end-user-doc --> | ||
56 | * @generated | ||
57 | */ | ||
58 | SocialnetworkPackage eINSTANCE = socialnetwork.impl.SocialnetworkPackageImpl.init(); | ||
59 | |||
60 | /** | ||
61 | * The meta object id for the '{@link socialnetwork.impl.SocialNetworkImpl <em>Social Network</em>}' class. | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @see socialnetwork.impl.SocialNetworkImpl | ||
65 | * @see socialnetwork.impl.SocialnetworkPackageImpl#getSocialNetwork() | ||
66 | * @generated | ||
67 | */ | ||
68 | int SOCIAL_NETWORK = 0; | ||
69 | |||
70 | /** | ||
71 | * The feature id for the '<em><b>Name</b></em>' attribute. | ||
72 | * <!-- begin-user-doc --> | ||
73 | * <!-- end-user-doc --> | ||
74 | * @generated | ||
75 | * @ordered | ||
76 | */ | ||
77 | int SOCIAL_NETWORK__NAME = 0; | ||
78 | |||
79 | /** | ||
80 | * The feature id for the '<em><b>Persons</b></em>' containment reference list. | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | * @ordered | ||
85 | */ | ||
86 | int SOCIAL_NETWORK__PERSONS = 1; | ||
87 | |||
88 | /** | ||
89 | * The number of structural features of the '<em>Social Network</em>' class. | ||
90 | * <!-- begin-user-doc --> | ||
91 | * <!-- end-user-doc --> | ||
92 | * @generated | ||
93 | * @ordered | ||
94 | */ | ||
95 | int SOCIAL_NETWORK_FEATURE_COUNT = 2; | ||
96 | |||
97 | /** | ||
98 | * The number of operations of the '<em>Social Network</em>' class. | ||
99 | * <!-- begin-user-doc --> | ||
100 | * <!-- end-user-doc --> | ||
101 | * @generated | ||
102 | * @ordered | ||
103 | */ | ||
104 | int SOCIAL_NETWORK_OPERATION_COUNT = 0; | ||
105 | |||
106 | /** | ||
107 | * The meta object id for the '{@link socialnetwork.impl.PersonImpl <em>Person</em>}' class. | ||
108 | * <!-- begin-user-doc --> | ||
109 | * <!-- end-user-doc --> | ||
110 | * @see socialnetwork.impl.PersonImpl | ||
111 | * @see socialnetwork.impl.SocialnetworkPackageImpl#getPerson() | ||
112 | * @generated | ||
113 | */ | ||
114 | int PERSON = 1; | ||
115 | |||
116 | /** | ||
117 | * The feature id for the '<em><b>Friends</b></em>' reference list. | ||
118 | * <!-- begin-user-doc --> | ||
119 | * <!-- end-user-doc --> | ||
120 | * @generated | ||
121 | * @ordered | ||
122 | */ | ||
123 | int PERSON__FRIENDS = 0; | ||
124 | |||
125 | /** | ||
126 | * The feature id for the '<em><b>Name</b></em>' attribute. | ||
127 | * <!-- begin-user-doc --> | ||
128 | * <!-- end-user-doc --> | ||
129 | * @generated | ||
130 | * @ordered | ||
131 | */ | ||
132 | int PERSON__NAME = 1; | ||
133 | |||
134 | /** | ||
135 | * The number of structural features of the '<em>Person</em>' class. | ||
136 | * <!-- begin-user-doc --> | ||
137 | * <!-- end-user-doc --> | ||
138 | * @generated | ||
139 | * @ordered | ||
140 | */ | ||
141 | int PERSON_FEATURE_COUNT = 2; | ||
142 | |||
143 | /** | ||
144 | * The number of operations of the '<em>Person</em>' class. | ||
145 | * <!-- begin-user-doc --> | ||
146 | * <!-- end-user-doc --> | ||
147 | * @generated | ||
148 | * @ordered | ||
149 | */ | ||
150 | int PERSON_OPERATION_COUNT = 0; | ||
151 | |||
152 | /** | ||
153 | * Returns the meta object for class '{@link socialnetwork.SocialNetwork <em>Social Network</em>}'. | ||
154 | * <!-- begin-user-doc --> | ||
155 | * <!-- end-user-doc --> | ||
156 | * @return the meta object for class '<em>Social Network</em>'. | ||
157 | * @see socialnetwork.SocialNetwork | ||
158 | * @generated | ||
159 | */ | ||
160 | EClass getSocialNetwork(); | ||
161 | |||
162 | /** | ||
163 | * Returns the meta object for the attribute '{@link socialnetwork.SocialNetwork#getName <em>Name</em>}'. | ||
164 | * <!-- begin-user-doc --> | ||
165 | * <!-- end-user-doc --> | ||
166 | * @return the meta object for the attribute '<em>Name</em>'. | ||
167 | * @see socialnetwork.SocialNetwork#getName() | ||
168 | * @see #getSocialNetwork() | ||
169 | * @generated | ||
170 | */ | ||
171 | EAttribute getSocialNetwork_Name(); | ||
172 | |||
173 | /** | ||
174 | * Returns the meta object for the containment reference list '{@link socialnetwork.SocialNetwork#getPersons <em>Persons</em>}'. | ||
175 | * <!-- begin-user-doc --> | ||
176 | * <!-- end-user-doc --> | ||
177 | * @return the meta object for the containment reference list '<em>Persons</em>'. | ||
178 | * @see socialnetwork.SocialNetwork#getPersons() | ||
179 | * @see #getSocialNetwork() | ||
180 | * @generated | ||
181 | */ | ||
182 | EReference getSocialNetwork_Persons(); | ||
183 | |||
184 | /** | ||
185 | * Returns the meta object for class '{@link socialnetwork.Person <em>Person</em>}'. | ||
186 | * <!-- begin-user-doc --> | ||
187 | * <!-- end-user-doc --> | ||
188 | * @return the meta object for class '<em>Person</em>'. | ||
189 | * @see socialnetwork.Person | ||
190 | * @generated | ||
191 | */ | ||
192 | EClass getPerson(); | ||
193 | |||
194 | /** | ||
195 | * Returns the meta object for the reference list '{@link socialnetwork.Person#getFriends <em>Friends</em>}'. | ||
196 | * <!-- begin-user-doc --> | ||
197 | * <!-- end-user-doc --> | ||
198 | * @return the meta object for the reference list '<em>Friends</em>'. | ||
199 | * @see socialnetwork.Person#getFriends() | ||
200 | * @see #getPerson() | ||
201 | * @generated | ||
202 | */ | ||
203 | EReference getPerson_Friends(); | ||
204 | |||
205 | /** | ||
206 | * Returns the meta object for the attribute '{@link socialnetwork.Person#getName <em>Name</em>}'. | ||
207 | * <!-- begin-user-doc --> | ||
208 | * <!-- end-user-doc --> | ||
209 | * @return the meta object for the attribute '<em>Name</em>'. | ||
210 | * @see socialnetwork.Person#getName() | ||
211 | * @see #getPerson() | ||
212 | * @generated | ||
213 | */ | ||
214 | EAttribute getPerson_Name(); | ||
215 | |||
216 | /** | ||
217 | * Returns the factory that creates the instances of the model. | ||
218 | * <!-- begin-user-doc --> | ||
219 | * <!-- end-user-doc --> | ||
220 | * @return the factory that creates the instances of the model. | ||
221 | * @generated | ||
222 | */ | ||
223 | SocialnetworkFactory getSocialnetworkFactory(); | ||
224 | |||
225 | /** | ||
226 | * <!-- begin-user-doc --> | ||
227 | * Defines literals for the meta objects that represent | ||
228 | * <ul> | ||
229 | * <li>each class,</li> | ||
230 | * <li>each feature of each class,</li> | ||
231 | * <li>each operation of each class,</li> | ||
232 | * <li>each enum,</li> | ||
233 | * <li>and each data type</li> | ||
234 | * </ul> | ||
235 | * <!-- end-user-doc --> | ||
236 | * @generated | ||
237 | */ | ||
238 | interface Literals { | ||
239 | /** | ||
240 | * The meta object literal for the '{@link socialnetwork.impl.SocialNetworkImpl <em>Social Network</em>}' class. | ||
241 | * <!-- begin-user-doc --> | ||
242 | * <!-- end-user-doc --> | ||
243 | * @see socialnetwork.impl.SocialNetworkImpl | ||
244 | * @see socialnetwork.impl.SocialnetworkPackageImpl#getSocialNetwork() | ||
245 | * @generated | ||
246 | */ | ||
247 | EClass SOCIAL_NETWORK = eINSTANCE.getSocialNetwork(); | ||
248 | |||
249 | /** | ||
250 | * The meta object literal for the '<em><b>Name</b></em>' attribute feature. | ||
251 | * <!-- begin-user-doc --> | ||
252 | * <!-- end-user-doc --> | ||
253 | * @generated | ||
254 | */ | ||
255 | EAttribute SOCIAL_NETWORK__NAME = eINSTANCE.getSocialNetwork_Name(); | ||
256 | |||
257 | /** | ||
258 | * The meta object literal for the '<em><b>Persons</b></em>' containment reference list feature. | ||
259 | * <!-- begin-user-doc --> | ||
260 | * <!-- end-user-doc --> | ||
261 | * @generated | ||
262 | */ | ||
263 | EReference SOCIAL_NETWORK__PERSONS = eINSTANCE.getSocialNetwork_Persons(); | ||
264 | |||
265 | /** | ||
266 | * The meta object literal for the '{@link socialnetwork.impl.PersonImpl <em>Person</em>}' class. | ||
267 | * <!-- begin-user-doc --> | ||
268 | * <!-- end-user-doc --> | ||
269 | * @see socialnetwork.impl.PersonImpl | ||
270 | * @see socialnetwork.impl.SocialnetworkPackageImpl#getPerson() | ||
271 | * @generated | ||
272 | */ | ||
273 | EClass PERSON = eINSTANCE.getPerson(); | ||
274 | |||
275 | /** | ||
276 | * The meta object literal for the '<em><b>Friends</b></em>' reference list feature. | ||
277 | * <!-- begin-user-doc --> | ||
278 | * <!-- end-user-doc --> | ||
279 | * @generated | ||
280 | */ | ||
281 | EReference PERSON__FRIENDS = eINSTANCE.getPerson_Friends(); | ||
282 | |||
283 | /** | ||
284 | * The meta object literal for the '<em><b>Name</b></em>' attribute feature. | ||
285 | * <!-- begin-user-doc --> | ||
286 | * <!-- end-user-doc --> | ||
287 | * @generated | ||
288 | */ | ||
289 | EAttribute PERSON__NAME = eINSTANCE.getPerson_Name(); | ||
290 | |||
291 | } | ||
292 | |||
293 | } //SocialnetworkPackage | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java new file mode 100644 index 00000000..d8bab731 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java | |||
@@ -0,0 +1,208 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Notification; | ||
8 | |||
9 | import org.eclipse.emf.common.util.EList; | ||
10 | |||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | |||
13 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
14 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
15 | |||
16 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; | ||
17 | |||
18 | import socialnetwork.Person; | ||
19 | import socialnetwork.SocialnetworkPackage; | ||
20 | |||
21 | /** | ||
22 | * <!-- begin-user-doc --> | ||
23 | * An implementation of the model object '<em><b>Person</b></em>'. | ||
24 | * <!-- end-user-doc --> | ||
25 | * <p> | ||
26 | * The following features are implemented: | ||
27 | * </p> | ||
28 | * <ul> | ||
29 | * <li>{@link socialnetwork.impl.PersonImpl#getFriends <em>Friends</em>}</li> | ||
30 | * <li>{@link socialnetwork.impl.PersonImpl#getName <em>Name</em>}</li> | ||
31 | * </ul> | ||
32 | * | ||
33 | * @generated | ||
34 | */ | ||
35 | public class PersonImpl extends MinimalEObjectImpl.Container implements Person { | ||
36 | /** | ||
37 | * The cached value of the '{@link #getFriends() <em>Friends</em>}' reference list. | ||
38 | * <!-- begin-user-doc --> | ||
39 | * <!-- end-user-doc --> | ||
40 | * @see #getFriends() | ||
41 | * @generated | ||
42 | * @ordered | ||
43 | */ | ||
44 | protected EList<Person> friends; | ||
45 | |||
46 | /** | ||
47 | * The default value of the '{@link #getName() <em>Name</em>}' attribute. | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @see #getName() | ||
51 | * @generated | ||
52 | * @ordered | ||
53 | */ | ||
54 | protected static final String NAME_EDEFAULT = "Name"; | ||
55 | |||
56 | /** | ||
57 | * The cached value of the '{@link #getName() <em>Name</em>}' attribute. | ||
58 | * <!-- begin-user-doc --> | ||
59 | * <!-- end-user-doc --> | ||
60 | * @see #getName() | ||
61 | * @generated | ||
62 | * @ordered | ||
63 | */ | ||
64 | protected String name = NAME_EDEFAULT; | ||
65 | |||
66 | /** | ||
67 | * <!-- begin-user-doc --> | ||
68 | * <!-- end-user-doc --> | ||
69 | * @generated | ||
70 | */ | ||
71 | protected PersonImpl() { | ||
72 | super(); | ||
73 | } | ||
74 | |||
75 | /** | ||
76 | * <!-- begin-user-doc --> | ||
77 | * <!-- end-user-doc --> | ||
78 | * @generated | ||
79 | */ | ||
80 | @Override | ||
81 | protected EClass eStaticClass() { | ||
82 | return SocialnetworkPackage.Literals.PERSON; | ||
83 | } | ||
84 | |||
85 | /** | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @generated | ||
89 | */ | ||
90 | @Override | ||
91 | public EList<Person> getFriends() { | ||
92 | if (friends == null) { | ||
93 | friends = new EObjectResolvingEList<Person>(Person.class, this, SocialnetworkPackage.PERSON__FRIENDS); | ||
94 | } | ||
95 | return friends; | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * <!-- begin-user-doc --> | ||
100 | * <!-- end-user-doc --> | ||
101 | * @generated | ||
102 | */ | ||
103 | @Override | ||
104 | public String getName() { | ||
105 | return name; | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * <!-- begin-user-doc --> | ||
110 | * <!-- end-user-doc --> | ||
111 | * @generated | ||
112 | */ | ||
113 | @Override | ||
114 | public void setName(String newName) { | ||
115 | String oldName = name; | ||
116 | name = newName; | ||
117 | if (eNotificationRequired()) | ||
118 | eNotify(new ENotificationImpl(this, Notification.SET, SocialnetworkPackage.PERSON__NAME, oldName, name)); | ||
119 | } | ||
120 | |||
121 | /** | ||
122 | * <!-- begin-user-doc --> | ||
123 | * <!-- end-user-doc --> | ||
124 | * @generated | ||
125 | */ | ||
126 | @Override | ||
127 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
128 | switch (featureID) { | ||
129 | case SocialnetworkPackage.PERSON__FRIENDS: | ||
130 | return getFriends(); | ||
131 | case SocialnetworkPackage.PERSON__NAME: | ||
132 | return getName(); | ||
133 | } | ||
134 | return super.eGet(featureID, resolve, coreType); | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * <!-- begin-user-doc --> | ||
139 | * <!-- end-user-doc --> | ||
140 | * @generated | ||
141 | */ | ||
142 | @SuppressWarnings("unchecked") | ||
143 | @Override | ||
144 | public void eSet(int featureID, Object newValue) { | ||
145 | switch (featureID) { | ||
146 | case SocialnetworkPackage.PERSON__FRIENDS: | ||
147 | getFriends().clear(); | ||
148 | getFriends().addAll((Collection<? extends Person>) newValue); | ||
149 | return; | ||
150 | case SocialnetworkPackage.PERSON__NAME: | ||
151 | setName((String) newValue); | ||
152 | return; | ||
153 | } | ||
154 | super.eSet(featureID, newValue); | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * <!-- begin-user-doc --> | ||
159 | * <!-- end-user-doc --> | ||
160 | * @generated | ||
161 | */ | ||
162 | @Override | ||
163 | public void eUnset(int featureID) { | ||
164 | switch (featureID) { | ||
165 | case SocialnetworkPackage.PERSON__FRIENDS: | ||
166 | getFriends().clear(); | ||
167 | return; | ||
168 | case SocialnetworkPackage.PERSON__NAME: | ||
169 | setName(NAME_EDEFAULT); | ||
170 | return; | ||
171 | } | ||
172 | super.eUnset(featureID); | ||
173 | } | ||
174 | |||
175 | /** | ||
176 | * <!-- begin-user-doc --> | ||
177 | * <!-- end-user-doc --> | ||
178 | * @generated | ||
179 | */ | ||
180 | @Override | ||
181 | public boolean eIsSet(int featureID) { | ||
182 | switch (featureID) { | ||
183 | case SocialnetworkPackage.PERSON__FRIENDS: | ||
184 | return friends != null && !friends.isEmpty(); | ||
185 | case SocialnetworkPackage.PERSON__NAME: | ||
186 | return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); | ||
187 | } | ||
188 | return super.eIsSet(featureID); | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * <!-- begin-user-doc --> | ||
193 | * <!-- end-user-doc --> | ||
194 | * @generated | ||
195 | */ | ||
196 | @Override | ||
197 | public String toString() { | ||
198 | if (eIsProxy()) | ||
199 | return super.toString(); | ||
200 | |||
201 | StringBuilder result = new StringBuilder(super.toString()); | ||
202 | result.append(" (name: "); | ||
203 | result.append(name); | ||
204 | result.append(')'); | ||
205 | return result.toString(); | ||
206 | } | ||
207 | |||
208 | } //PersonImpl | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java new file mode 100644 index 00000000..cb28b749 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java | |||
@@ -0,0 +1,228 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Notification; | ||
8 | import org.eclipse.emf.common.notify.NotificationChain; | ||
9 | |||
10 | import org.eclipse.emf.common.util.EList; | ||
11 | |||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.emf.ecore.InternalEObject; | ||
14 | |||
15 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
16 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
17 | |||
18 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
19 | import org.eclipse.emf.ecore.util.InternalEList; | ||
20 | |||
21 | import socialnetwork.Person; | ||
22 | import socialnetwork.SocialNetwork; | ||
23 | import socialnetwork.SocialnetworkPackage; | ||
24 | |||
25 | /** | ||
26 | * <!-- begin-user-doc --> | ||
27 | * An implementation of the model object '<em><b>Social Network</b></em>'. | ||
28 | * <!-- end-user-doc --> | ||
29 | * <p> | ||
30 | * The following features are implemented: | ||
31 | * </p> | ||
32 | * <ul> | ||
33 | * <li>{@link socialnetwork.impl.SocialNetworkImpl#getName <em>Name</em>}</li> | ||
34 | * <li>{@link socialnetwork.impl.SocialNetworkImpl#getPersons <em>Persons</em>}</li> | ||
35 | * </ul> | ||
36 | * | ||
37 | * @generated | ||
38 | */ | ||
39 | public class SocialNetworkImpl extends MinimalEObjectImpl.Container implements SocialNetwork { | ||
40 | /** | ||
41 | * The default value of the '{@link #getName() <em>Name</em>}' attribute. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @see #getName() | ||
45 | * @generated | ||
46 | * @ordered | ||
47 | */ | ||
48 | protected static final String NAME_EDEFAULT = "SocialNetwork"; | ||
49 | |||
50 | /** | ||
51 | * The cached value of the '{@link #getName() <em>Name</em>}' attribute. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @see #getName() | ||
55 | * @generated | ||
56 | * @ordered | ||
57 | */ | ||
58 | protected String name = NAME_EDEFAULT; | ||
59 | |||
60 | /** | ||
61 | * The cached value of the '{@link #getPersons() <em>Persons</em>}' containment reference list. | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @see #getPersons() | ||
65 | * @generated | ||
66 | * @ordered | ||
67 | */ | ||
68 | protected EList<Person> persons; | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | protected SocialNetworkImpl() { | ||
76 | super(); | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | @Override | ||
85 | protected EClass eStaticClass() { | ||
86 | return SocialnetworkPackage.Literals.SOCIAL_NETWORK; | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * <!-- begin-user-doc --> | ||
91 | * <!-- end-user-doc --> | ||
92 | * @generated | ||
93 | */ | ||
94 | @Override | ||
95 | public String getName() { | ||
96 | return name; | ||
97 | } | ||
98 | |||
99 | /** | ||
100 | * <!-- begin-user-doc --> | ||
101 | * <!-- end-user-doc --> | ||
102 | * @generated | ||
103 | */ | ||
104 | @Override | ||
105 | public void setName(String newName) { | ||
106 | String oldName = name; | ||
107 | name = newName; | ||
108 | if (eNotificationRequired()) | ||
109 | eNotify(new ENotificationImpl(this, Notification.SET, SocialnetworkPackage.SOCIAL_NETWORK__NAME, oldName, | ||
110 | name)); | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * <!-- begin-user-doc --> | ||
115 | * <!-- end-user-doc --> | ||
116 | * @generated | ||
117 | */ | ||
118 | @Override | ||
119 | public EList<Person> getPersons() { | ||
120 | if (persons == null) { | ||
121 | persons = new EObjectContainmentEList<Person>(Person.class, this, | ||
122 | SocialnetworkPackage.SOCIAL_NETWORK__PERSONS); | ||
123 | } | ||
124 | return persons; | ||
125 | } | ||
126 | |||
127 | /** | ||
128 | * <!-- begin-user-doc --> | ||
129 | * <!-- end-user-doc --> | ||
130 | * @generated | ||
131 | */ | ||
132 | @Override | ||
133 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
134 | switch (featureID) { | ||
135 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
136 | return ((InternalEList<?>) getPersons()).basicRemove(otherEnd, msgs); | ||
137 | } | ||
138 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
139 | } | ||
140 | |||
141 | /** | ||
142 | * <!-- begin-user-doc --> | ||
143 | * <!-- end-user-doc --> | ||
144 | * @generated | ||
145 | */ | ||
146 | @Override | ||
147 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
148 | switch (featureID) { | ||
149 | case SocialnetworkPackage.SOCIAL_NETWORK__NAME: | ||
150 | return getName(); | ||
151 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
152 | return getPersons(); | ||
153 | } | ||
154 | return super.eGet(featureID, resolve, coreType); | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * <!-- begin-user-doc --> | ||
159 | * <!-- end-user-doc --> | ||
160 | * @generated | ||
161 | */ | ||
162 | @SuppressWarnings("unchecked") | ||
163 | @Override | ||
164 | public void eSet(int featureID, Object newValue) { | ||
165 | switch (featureID) { | ||
166 | case SocialnetworkPackage.SOCIAL_NETWORK__NAME: | ||
167 | setName((String) newValue); | ||
168 | return; | ||
169 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
170 | getPersons().clear(); | ||
171 | getPersons().addAll((Collection<? extends Person>) newValue); | ||
172 | return; | ||
173 | } | ||
174 | super.eSet(featureID, newValue); | ||
175 | } | ||
176 | |||
177 | /** | ||
178 | * <!-- begin-user-doc --> | ||
179 | * <!-- end-user-doc --> | ||
180 | * @generated | ||
181 | */ | ||
182 | @Override | ||
183 | public void eUnset(int featureID) { | ||
184 | switch (featureID) { | ||
185 | case SocialnetworkPackage.SOCIAL_NETWORK__NAME: | ||
186 | setName(NAME_EDEFAULT); | ||
187 | return; | ||
188 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
189 | getPersons().clear(); | ||
190 | return; | ||
191 | } | ||
192 | super.eUnset(featureID); | ||
193 | } | ||
194 | |||
195 | /** | ||
196 | * <!-- begin-user-doc --> | ||
197 | * <!-- end-user-doc --> | ||
198 | * @generated | ||
199 | */ | ||
200 | @Override | ||
201 | public boolean eIsSet(int featureID) { | ||
202 | switch (featureID) { | ||
203 | case SocialnetworkPackage.SOCIAL_NETWORK__NAME: | ||
204 | return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); | ||
205 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
206 | return persons != null && !persons.isEmpty(); | ||
207 | } | ||
208 | return super.eIsSet(featureID); | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | * <!-- begin-user-doc --> | ||
213 | * <!-- end-user-doc --> | ||
214 | * @generated | ||
215 | */ | ||
216 | @Override | ||
217 | public String toString() { | ||
218 | if (eIsProxy()) | ||
219 | return super.toString(); | ||
220 | |||
221 | StringBuilder result = new StringBuilder(super.toString()); | ||
222 | result.append(" (name: "); | ||
223 | result.append(name); | ||
224 | result.append(')'); | ||
225 | return result.toString(); | ||
226 | } | ||
227 | |||
228 | } //SocialNetworkImpl | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java new file mode 100644 index 00000000..87fa3a87 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java | |||
@@ -0,0 +1,111 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import org.eclipse.emf.ecore.EObject; | ||
7 | import org.eclipse.emf.ecore.EPackage; | ||
8 | |||
9 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
10 | |||
11 | import org.eclipse.emf.ecore.plugin.EcorePlugin; | ||
12 | |||
13 | import socialnetwork.*; | ||
14 | |||
15 | /** | ||
16 | * <!-- begin-user-doc --> | ||
17 | * An implementation of the model <b>Factory</b>. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @generated | ||
20 | */ | ||
21 | public class SocialnetworkFactoryImpl extends EFactoryImpl implements SocialnetworkFactory { | ||
22 | /** | ||
23 | * Creates the default factory implementation. | ||
24 | * <!-- begin-user-doc --> | ||
25 | * <!-- end-user-doc --> | ||
26 | * @generated | ||
27 | */ | ||
28 | public static SocialnetworkFactory init() { | ||
29 | try { | ||
30 | SocialnetworkFactory theSocialnetworkFactory = (SocialnetworkFactory) EPackage.Registry.INSTANCE | ||
31 | .getEFactory(SocialnetworkPackage.eNS_URI); | ||
32 | if (theSocialnetworkFactory != null) { | ||
33 | return theSocialnetworkFactory; | ||
34 | } | ||
35 | } catch (Exception exception) { | ||
36 | EcorePlugin.INSTANCE.log(exception); | ||
37 | } | ||
38 | return new SocialnetworkFactoryImpl(); | ||
39 | } | ||
40 | |||
41 | /** | ||
42 | * Creates an instance of the factory. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @generated | ||
46 | */ | ||
47 | public SocialnetworkFactoryImpl() { | ||
48 | super(); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | @Override | ||
57 | public EObject create(EClass eClass) { | ||
58 | switch (eClass.getClassifierID()) { | ||
59 | case SocialnetworkPackage.SOCIAL_NETWORK: | ||
60 | return createSocialNetwork(); | ||
61 | case SocialnetworkPackage.PERSON: | ||
62 | return createPerson(); | ||
63 | default: | ||
64 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | ||
65 | } | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * <!-- begin-user-doc --> | ||
70 | * <!-- end-user-doc --> | ||
71 | * @generated | ||
72 | */ | ||
73 | @Override | ||
74 | public SocialNetwork createSocialNetwork() { | ||
75 | SocialNetworkImpl socialNetwork = new SocialNetworkImpl(); | ||
76 | return socialNetwork; | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | @Override | ||
85 | public Person createPerson() { | ||
86 | PersonImpl person = new PersonImpl(); | ||
87 | return person; | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * <!-- begin-user-doc --> | ||
92 | * <!-- end-user-doc --> | ||
93 | * @generated | ||
94 | */ | ||
95 | @Override | ||
96 | public SocialnetworkPackage getSocialnetworkPackage() { | ||
97 | return (SocialnetworkPackage) getEPackage(); | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * <!-- begin-user-doc --> | ||
102 | * <!-- end-user-doc --> | ||
103 | * @deprecated | ||
104 | * @generated | ||
105 | */ | ||
106 | @Deprecated | ||
107 | public static SocialnetworkPackage getPackage() { | ||
108 | return SocialnetworkPackage.eINSTANCE; | ||
109 | } | ||
110 | |||
111 | } //SocialnetworkFactoryImpl | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java new file mode 100644 index 00000000..7588df50 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java | |||
@@ -0,0 +1,267 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EAttribute; | ||
6 | import org.eclipse.emf.ecore.EClass; | ||
7 | import org.eclipse.emf.ecore.EPackage; | ||
8 | import org.eclipse.emf.ecore.EReference; | ||
9 | |||
10 | import org.eclipse.emf.ecore.impl.EPackageImpl; | ||
11 | |||
12 | import socialnetwork.Person; | ||
13 | import socialnetwork.SocialNetwork; | ||
14 | import socialnetwork.SocialnetworkFactory; | ||
15 | import socialnetwork.SocialnetworkPackage; | ||
16 | |||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * An implementation of the model <b>Package</b>. | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | public class SocialnetworkPackageImpl extends EPackageImpl implements SocialnetworkPackage { | ||
24 | /** | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | private EClass socialNetworkEClass = null; | ||
30 | |||
31 | /** | ||
32 | * <!-- begin-user-doc --> | ||
33 | * <!-- end-user-doc --> | ||
34 | * @generated | ||
35 | */ | ||
36 | private EClass personEClass = null; | ||
37 | |||
38 | /** | ||
39 | * Creates an instance of the model <b>Package</b>, registered with | ||
40 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package | ||
41 | * package URI value. | ||
42 | * <p>Note: the correct way to create the package is via the static | ||
43 | * factory method {@link #init init()}, which also performs | ||
44 | * initialization of the package, or returns the registered package, | ||
45 | * if one already exists. | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @see org.eclipse.emf.ecore.EPackage.Registry | ||
49 | * @see socialnetwork.SocialnetworkPackage#eNS_URI | ||
50 | * @see #init() | ||
51 | * @generated | ||
52 | */ | ||
53 | private SocialnetworkPackageImpl() { | ||
54 | super(eNS_URI, SocialnetworkFactory.eINSTANCE); | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * <!-- begin-user-doc --> | ||
59 | * <!-- end-user-doc --> | ||
60 | * @generated | ||
61 | */ | ||
62 | private static boolean isInited = false; | ||
63 | |||
64 | /** | ||
65 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | ||
66 | * | ||
67 | * <p>This method is used to initialize {@link SocialnetworkPackage#eINSTANCE} when that field is accessed. | ||
68 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | ||
69 | * <!-- begin-user-doc --> | ||
70 | * <!-- end-user-doc --> | ||
71 | * @see #eNS_URI | ||
72 | * @see #createPackageContents() | ||
73 | * @see #initializePackageContents() | ||
74 | * @generated | ||
75 | */ | ||
76 | public static SocialnetworkPackage init() { | ||
77 | if (isInited) | ||
78 | return (SocialnetworkPackage) EPackage.Registry.INSTANCE.getEPackage(SocialnetworkPackage.eNS_URI); | ||
79 | |||
80 | // Obtain or create and register package | ||
81 | Object registeredSocialnetworkPackage = EPackage.Registry.INSTANCE.get(eNS_URI); | ||
82 | SocialnetworkPackageImpl theSocialnetworkPackage = registeredSocialnetworkPackage instanceof SocialnetworkPackageImpl | ||
83 | ? (SocialnetworkPackageImpl) registeredSocialnetworkPackage | ||
84 | : new SocialnetworkPackageImpl(); | ||
85 | |||
86 | isInited = true; | ||
87 | |||
88 | // Create package meta-data objects | ||
89 | theSocialnetworkPackage.createPackageContents(); | ||
90 | |||
91 | // Initialize created meta-data | ||
92 | theSocialnetworkPackage.initializePackageContents(); | ||
93 | |||
94 | // Mark meta-data to indicate it can't be changed | ||
95 | theSocialnetworkPackage.freeze(); | ||
96 | |||
97 | // Update the registry and return the package | ||
98 | EPackage.Registry.INSTANCE.put(SocialnetworkPackage.eNS_URI, theSocialnetworkPackage); | ||
99 | return theSocialnetworkPackage; | ||
100 | } | ||
101 | |||
102 | /** | ||
103 | * <!-- begin-user-doc --> | ||
104 | * <!-- end-user-doc --> | ||
105 | * @generated | ||
106 | */ | ||
107 | @Override | ||
108 | public EClass getSocialNetwork() { | ||
109 | return socialNetworkEClass; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * <!-- begin-user-doc --> | ||
114 | * <!-- end-user-doc --> | ||
115 | * @generated | ||
116 | */ | ||
117 | @Override | ||
118 | public EAttribute getSocialNetwork_Name() { | ||
119 | return (EAttribute) socialNetworkEClass.getEStructuralFeatures().get(0); | ||
120 | } | ||
121 | |||
122 | /** | ||
123 | * <!-- begin-user-doc --> | ||
124 | * <!-- end-user-doc --> | ||
125 | * @generated | ||
126 | */ | ||
127 | @Override | ||
128 | public EReference getSocialNetwork_Persons() { | ||
129 | return (EReference) socialNetworkEClass.getEStructuralFeatures().get(1); | ||
130 | } | ||
131 | |||
132 | /** | ||
133 | * <!-- begin-user-doc --> | ||
134 | * <!-- end-user-doc --> | ||
135 | * @generated | ||
136 | */ | ||
137 | @Override | ||
138 | public EClass getPerson() { | ||
139 | return personEClass; | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * <!-- begin-user-doc --> | ||
144 | * <!-- end-user-doc --> | ||
145 | * @generated | ||
146 | */ | ||
147 | @Override | ||
148 | public EReference getPerson_Friends() { | ||
149 | return (EReference) personEClass.getEStructuralFeatures().get(0); | ||
150 | } | ||
151 | |||
152 | /** | ||
153 | * <!-- begin-user-doc --> | ||
154 | * <!-- end-user-doc --> | ||
155 | * @generated | ||
156 | */ | ||
157 | @Override | ||
158 | public EAttribute getPerson_Name() { | ||
159 | return (EAttribute) personEClass.getEStructuralFeatures().get(1); | ||
160 | } | ||
161 | |||
162 | /** | ||
163 | * <!-- begin-user-doc --> | ||
164 | * <!-- end-user-doc --> | ||
165 | * @generated | ||
166 | */ | ||
167 | @Override | ||
168 | public SocialnetworkFactory getSocialnetworkFactory() { | ||
169 | return (SocialnetworkFactory) getEFactoryInstance(); | ||
170 | } | ||
171 | |||
172 | /** | ||
173 | * <!-- begin-user-doc --> | ||
174 | * <!-- end-user-doc --> | ||
175 | * @generated | ||
176 | */ | ||
177 | private boolean isCreated = false; | ||
178 | |||
179 | /** | ||
180 | * Creates the meta-model objects for the package. This method is | ||
181 | * guarded to have no affect on any invocation but its first. | ||
182 | * <!-- begin-user-doc --> | ||
183 | * <!-- end-user-doc --> | ||
184 | * @generated | ||
185 | */ | ||
186 | public void createPackageContents() { | ||
187 | if (isCreated) | ||
188 | return; | ||
189 | isCreated = true; | ||
190 | |||
191 | // Create classes and their features | ||
192 | socialNetworkEClass = createEClass(SOCIAL_NETWORK); | ||
193 | createEAttribute(socialNetworkEClass, SOCIAL_NETWORK__NAME); | ||
194 | createEReference(socialNetworkEClass, SOCIAL_NETWORK__PERSONS); | ||
195 | |||
196 | personEClass = createEClass(PERSON); | ||
197 | createEReference(personEClass, PERSON__FRIENDS); | ||
198 | createEAttribute(personEClass, PERSON__NAME); | ||
199 | } | ||
200 | |||
201 | /** | ||
202 | * <!-- begin-user-doc --> | ||
203 | * <!-- end-user-doc --> | ||
204 | * @generated | ||
205 | */ | ||
206 | private boolean isInitialized = false; | ||
207 | |||
208 | /** | ||
209 | * Complete the initialization of the package and its meta-model. This | ||
210 | * method is guarded to have no affect on any invocation but its first. | ||
211 | * <!-- begin-user-doc --> | ||
212 | * <!-- end-user-doc --> | ||
213 | * @generated | ||
214 | */ | ||
215 | public void initializePackageContents() { | ||
216 | if (isInitialized) | ||
217 | return; | ||
218 | isInitialized = true; | ||
219 | |||
220 | // Initialize package | ||
221 | setName(eNAME); | ||
222 | setNsPrefix(eNS_PREFIX); | ||
223 | setNsURI(eNS_URI); | ||
224 | |||
225 | // Create type parameters | ||
226 | |||
227 | // Set bounds for type parameters | ||
228 | |||
229 | // Add supertypes to classes | ||
230 | |||
231 | // Initialize classes, features, and operations; add parameters | ||
232 | initEClass(socialNetworkEClass, SocialNetwork.class, "SocialNetwork", !IS_ABSTRACT, !IS_INTERFACE, | ||
233 | IS_GENERATED_INSTANCE_CLASS); | ||
234 | initEAttribute(getSocialNetwork_Name(), ecorePackage.getEString(), "name", "SocialNetwork", 0, 1, | ||
235 | SocialNetwork.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, | ||
236 | !IS_DERIVED, IS_ORDERED); | ||
237 | initEReference(getSocialNetwork_Persons(), this.getPerson(), null, "persons", null, 0, -1, SocialNetwork.class, | ||
238 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, | ||
239 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
240 | |||
241 | initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
242 | initEReference(getPerson_Friends(), this.getPerson(), null, "friends", null, 0, -1, Person.class, !IS_TRANSIENT, | ||
243 | !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, | ||
244 | IS_ORDERED); | ||
245 | initEAttribute(getPerson_Name(), ecorePackage.getEString(), "name", "Name", 0, 1, Person.class, !IS_TRANSIENT, | ||
246 | !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
247 | |||
248 | // Create resource | ||
249 | createResource(eNS_URI); | ||
250 | |||
251 | // Create annotations | ||
252 | // http://www.eclipse.org/emf/2002/Ecore | ||
253 | createEcoreAnnotations(); | ||
254 | } | ||
255 | |||
256 | /** | ||
257 | * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. | ||
258 | * <!-- begin-user-doc --> | ||
259 | * <!-- end-user-doc --> | ||
260 | * @generated | ||
261 | */ | ||
262 | protected void createEcoreAnnotations() { | ||
263 | String source = "http://www.eclipse.org/emf/2002/Ecore"; | ||
264 | addAnnotation(this, source, new String[] {}); | ||
265 | } | ||
266 | |||
267 | } //SocialnetworkPackageImpl | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkAdapterFactory.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkAdapterFactory.java new file mode 100644 index 00000000..0dd30975 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkAdapterFactory.java | |||
@@ -0,0 +1,138 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.util; | ||
4 | |||
5 | import org.eclipse.emf.common.notify.Adapter; | ||
6 | import org.eclipse.emf.common.notify.Notifier; | ||
7 | |||
8 | import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; | ||
9 | |||
10 | import org.eclipse.emf.ecore.EObject; | ||
11 | |||
12 | import socialnetwork.*; | ||
13 | |||
14 | /** | ||
15 | * <!-- begin-user-doc --> | ||
16 | * The <b>Adapter Factory</b> for the model. | ||
17 | * It provides an adapter <code>createXXX</code> method for each class of the model. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @see socialnetwork.SocialnetworkPackage | ||
20 | * @generated | ||
21 | */ | ||
22 | public class SocialnetworkAdapterFactory extends AdapterFactoryImpl { | ||
23 | /** | ||
24 | * The cached model package. | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | protected static SocialnetworkPackage modelPackage; | ||
30 | |||
31 | /** | ||
32 | * Creates an instance of the adapter factory. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @generated | ||
36 | */ | ||
37 | public SocialnetworkAdapterFactory() { | ||
38 | if (modelPackage == null) { | ||
39 | modelPackage = SocialnetworkPackage.eINSTANCE; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * Returns whether this factory is applicable for the type of the object. | ||
45 | * <!-- begin-user-doc --> | ||
46 | * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. | ||
47 | * <!-- end-user-doc --> | ||
48 | * @return whether this factory is applicable for the type of the object. | ||
49 | * @generated | ||
50 | */ | ||
51 | @Override | ||
52 | public boolean isFactoryForType(Object object) { | ||
53 | if (object == modelPackage) { | ||
54 | return true; | ||
55 | } | ||
56 | if (object instanceof EObject) { | ||
57 | return ((EObject) object).eClass().getEPackage() == modelPackage; | ||
58 | } | ||
59 | return false; | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * The switch that delegates to the <code>createXXX</code> methods. | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @generated | ||
67 | */ | ||
68 | protected SocialnetworkSwitch<Adapter> modelSwitch = new SocialnetworkSwitch<Adapter>() { | ||
69 | @Override | ||
70 | public Adapter caseSocialNetwork(SocialNetwork object) { | ||
71 | return createSocialNetworkAdapter(); | ||
72 | } | ||
73 | |||
74 | @Override | ||
75 | public Adapter casePerson(Person object) { | ||
76 | return createPersonAdapter(); | ||
77 | } | ||
78 | |||
79 | @Override | ||
80 | public Adapter defaultCase(EObject object) { | ||
81 | return createEObjectAdapter(); | ||
82 | } | ||
83 | }; | ||
84 | |||
85 | /** | ||
86 | * Creates an adapter for the <code>target</code>. | ||
87 | * <!-- begin-user-doc --> | ||
88 | * <!-- end-user-doc --> | ||
89 | * @param target the object to adapt. | ||
90 | * @return the adapter for the <code>target</code>. | ||
91 | * @generated | ||
92 | */ | ||
93 | @Override | ||
94 | public Adapter createAdapter(Notifier target) { | ||
95 | return modelSwitch.doSwitch((EObject) target); | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * Creates a new adapter for an object of class '{@link socialnetwork.SocialNetwork <em>Social Network</em>}'. | ||
100 | * <!-- begin-user-doc --> | ||
101 | * This default implementation returns null so that we can easily ignore cases; | ||
102 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
103 | * <!-- end-user-doc --> | ||
104 | * @return the new adapter. | ||
105 | * @see socialnetwork.SocialNetwork | ||
106 | * @generated | ||
107 | */ | ||
108 | public Adapter createSocialNetworkAdapter() { | ||
109 | return null; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * Creates a new adapter for an object of class '{@link socialnetwork.Person <em>Person</em>}'. | ||
114 | * <!-- begin-user-doc --> | ||
115 | * This default implementation returns null so that we can easily ignore cases; | ||
116 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
117 | * <!-- end-user-doc --> | ||
118 | * @return the new adapter. | ||
119 | * @see socialnetwork.Person | ||
120 | * @generated | ||
121 | */ | ||
122 | public Adapter createPersonAdapter() { | ||
123 | return null; | ||
124 | } | ||
125 | |||
126 | /** | ||
127 | * Creates a new adapter for the default case. | ||
128 | * <!-- begin-user-doc --> | ||
129 | * This default implementation returns null. | ||
130 | * <!-- end-user-doc --> | ||
131 | * @return the new adapter. | ||
132 | * @generated | ||
133 | */ | ||
134 | public Adapter createEObjectAdapter() { | ||
135 | return null; | ||
136 | } | ||
137 | |||
138 | } //SocialnetworkAdapterFactory | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkSwitch.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkSwitch.java new file mode 100644 index 00000000..00d7955c --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkSwitch.java | |||
@@ -0,0 +1,134 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.util; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EObject; | ||
6 | import org.eclipse.emf.ecore.EPackage; | ||
7 | |||
8 | import org.eclipse.emf.ecore.util.Switch; | ||
9 | |||
10 | import socialnetwork.*; | ||
11 | |||
12 | /** | ||
13 | * <!-- begin-user-doc --> | ||
14 | * The <b>Switch</b> for the model's inheritance hierarchy. | ||
15 | * It supports the call {@link #doSwitch(EObject) doSwitch(object)} | ||
16 | * to invoke the <code>caseXXX</code> method for each class of the model, | ||
17 | * starting with the actual class of the object | ||
18 | * and proceeding up the inheritance hierarchy | ||
19 | * until a non-null result is returned, | ||
20 | * which is the result of the switch. | ||
21 | * <!-- end-user-doc --> | ||
22 | * @see socialnetwork.SocialnetworkPackage | ||
23 | * @generated | ||
24 | */ | ||
25 | public class SocialnetworkSwitch<T> extends Switch<T> { | ||
26 | /** | ||
27 | * The cached model package | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | protected static SocialnetworkPackage modelPackage; | ||
33 | |||
34 | /** | ||
35 | * Creates an instance of the switch. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @generated | ||
39 | */ | ||
40 | public SocialnetworkSwitch() { | ||
41 | if (modelPackage == null) { | ||
42 | modelPackage = SocialnetworkPackage.eINSTANCE; | ||
43 | } | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * Checks whether this is a switch for the given package. | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @param ePackage the package in question. | ||
51 | * @return whether this is a switch for the given package. | ||
52 | * @generated | ||
53 | */ | ||
54 | @Override | ||
55 | protected boolean isSwitchFor(EPackage ePackage) { | ||
56 | return ePackage == modelPackage; | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @return the first non-null result returned by a <code>caseXXX</code> call. | ||
64 | * @generated | ||
65 | */ | ||
66 | @Override | ||
67 | protected T doSwitch(int classifierID, EObject theEObject) { | ||
68 | switch (classifierID) { | ||
69 | case SocialnetworkPackage.SOCIAL_NETWORK: { | ||
70 | SocialNetwork socialNetwork = (SocialNetwork) theEObject; | ||
71 | T result = caseSocialNetwork(socialNetwork); | ||
72 | if (result == null) | ||
73 | result = defaultCase(theEObject); | ||
74 | return result; | ||
75 | } | ||
76 | case SocialnetworkPackage.PERSON: { | ||
77 | Person person = (Person) theEObject; | ||
78 | T result = casePerson(person); | ||
79 | if (result == null) | ||
80 | result = defaultCase(theEObject); | ||
81 | return result; | ||
82 | } | ||
83 | default: | ||
84 | return defaultCase(theEObject); | ||
85 | } | ||
86 | } | ||
87 | |||
88 | /** | ||
89 | * Returns the result of interpreting the object as an instance of '<em>Social Network</em>'. | ||
90 | * <!-- begin-user-doc --> | ||
91 | * This implementation returns null; | ||
92 | * returning a non-null result will terminate the switch. | ||
93 | * <!-- end-user-doc --> | ||
94 | * @param object the target of the switch. | ||
95 | * @return the result of interpreting the object as an instance of '<em>Social Network</em>'. | ||
96 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
97 | * @generated | ||
98 | */ | ||
99 | public T caseSocialNetwork(SocialNetwork object) { | ||
100 | return null; | ||
101 | } | ||
102 | |||
103 | /** | ||
104 | * Returns the result of interpreting the object as an instance of '<em>Person</em>'. | ||
105 | * <!-- begin-user-doc --> | ||
106 | * This implementation returns null; | ||
107 | * returning a non-null result will terminate the switch. | ||
108 | * <!-- end-user-doc --> | ||
109 | * @param object the target of the switch. | ||
110 | * @return the result of interpreting the object as an instance of '<em>Person</em>'. | ||
111 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
112 | * @generated | ||
113 | */ | ||
114 | public T casePerson(Person object) { | ||
115 | return null; | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
120 | * <!-- begin-user-doc --> | ||
121 | * This implementation returns null; | ||
122 | * returning a non-null result will terminate the switch, but this is the last case anyway. | ||
123 | * <!-- end-user-doc --> | ||
124 | * @param object the target of the switch. | ||
125 | * @return the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
126 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) | ||
127 | * @generated | ||
128 | */ | ||
129 | @Override | ||
130 | public T defaultCase(EObject object) { | ||
131 | return null; | ||
132 | } | ||
133 | |||
134 | } //SocialnetworkSwitch | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/generator.vqgen b/Metrics/Metrics-Calculation/SocialNetwork_plugin/generator.vqgen new file mode 100644 index 00000000..902285d1 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/generator.vqgen | |||
@@ -0,0 +1 @@ | |||
genmodel "platform:/resource/SocialNetwork_plugin/model/socialnetwork.genmodel" \ No newline at end of file | |||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/.gitignore new file mode 100644 index 00000000..17126b28 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/.gitignore | |||
@@ -0,0 +1,4 @@ | |||
1 | # ignore everything in this folder except for this folder it self | ||
2 | |||
3 | * | ||
4 | !.gitignore \ No newline at end of file | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.aird b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.aird new file mode 100644 index 00000000..e7e28ecd --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.aird | |||
@@ -0,0 +1,183 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style"> | ||
3 | <viewpoint:DAnalysis uid="_TZr30HA1EemKP426GDjFOg" selectedViews="_Ta8cEHA1EemKP426GDjFOg" version="14.1.0.201810161215"> | ||
4 | <semanticResources>socialnetwork.ecore</semanticResources> | ||
5 | <semanticResources>socialnetwork.genmodel</semanticResources> | ||
6 | <ownedViews xmi:type="viewpoint:DView" uid="_Ta8cEHA1EemKP426GDjFOg"> | ||
7 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> | ||
8 | <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_TbTBZXA1EemKP426GDjFOg" name="socialnetwork" repPath="#_TbTBYHA1EemKP426GDjFOg"> | ||
9 | <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> | ||
10 | <target xmi:type="ecore:EPackage" href="socialnetwork.ecore#/"/> | ||
11 | </ownedRepresentationDescriptors> | ||
12 | </ownedViews> | ||
13 | </viewpoint:DAnalysis> | ||
14 | <diagram:DSemanticDiagram uid="_TbTBYHA1EemKP426GDjFOg" name="socialnetwork"> | ||
15 | <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_TbTBYXA1EemKP426GDjFOg" source="DANNOTATION_CUSTOMIZATION_KEY"> | ||
16 | <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_TbTBYnA1EemKP426GDjFOg"> | ||
17 | <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_ZZkWoHA1EemKP426GDjFOg" sourceArrow="FillDiamond" routingStyle="manhattan"> | ||
18 | <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
19 | <centerLabelStyleDescription xmi:type="style:CenterLabelStyleDescription" xmi:id="_ZZkWoXA1EemKP426GDjFOg" showIcon="false" labelExpression="service:render"> | ||
20 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
21 | </centerLabelStyleDescription> | ||
22 | <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_ZZkWonA1EemKP426GDjFOg" labelSize="6" showIcon="false" labelExpression="service:eKeysLabel"> | ||
23 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/> | ||
24 | </endLabelStyleDescription> | ||
25 | </computedStyleDescriptions> | ||
26 | </data> | ||
27 | </ownedAnnotationEntries> | ||
28 | <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_TbTBZnA1EemKP426GDjFOg" source="GMF_DIAGRAMS"> | ||
29 | <data xmi:type="notation:Diagram" xmi:id="_TbTBZ3A1EemKP426GDjFOg" type="Sirius" element="_TbTBYHA1EemKP426GDjFOg" measurementUnit="Pixel"> | ||
30 | <children xmi:type="notation:Node" xmi:id="_Ur9YAHA1EemKP426GDjFOg" type="2003" element="_Ur5GkHA1EemKP426GDjFOg"> | ||
31 | <children xmi:type="notation:Node" xmi:id="_Ur9YA3A1EemKP426GDjFOg" type="5007"/> | ||
32 | <children xmi:type="notation:Node" xmi:id="_Ur9YBHA1EemKP426GDjFOg" type="7004"> | ||
33 | <children xmi:type="notation:Node" xmi:id="_W_L-4HA1EemKP426GDjFOg" type="3010" element="_W_DcAHA1EemKP426GDjFOg"> | ||
34 | <styles xmi:type="notation:FontStyle" xmi:id="_W_L-4XA1EemKP426GDjFOg" fontColor="2697711" fontName="Segoe UI" fontHeight="8"/> | ||
35 | <layoutConstraint xmi:type="notation:Location" xmi:id="_W_L-4nA1EemKP426GDjFOg"/> | ||
36 | </children> | ||
37 | <styles xmi:type="notation:SortingStyle" xmi:id="_Ur9YBXA1EemKP426GDjFOg"/> | ||
38 | <styles xmi:type="notation:FilteringStyle" xmi:id="_Ur9YBnA1EemKP426GDjFOg"/> | ||
39 | </children> | ||
40 | <styles xmi:type="notation:ShapeStyle" xmi:id="_Ur9YAXA1EemKP426GDjFOg" fontName="Segoe UI" fontHeight="8"/> | ||
41 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Ur9YAnA1EemKP426GDjFOg" x="285" y="165" width="120" height="100"/> | ||
42 | </children> | ||
43 | <children xmi:type="notation:Node" xmi:id="_X2ASIHA1EemKP426GDjFOg" type="2003" element="_X14WUHA1EemKP426GDjFOg"> | ||
44 | <children xmi:type="notation:Node" xmi:id="_X2A5MHA1EemKP426GDjFOg" type="5007"/> | ||
45 | <children xmi:type="notation:Node" xmi:id="_X2A5MXA1EemKP426GDjFOg" type="7004"> | ||
46 | <children xmi:type="notation:Node" xmi:id="_jitw4HA1EemKP426GDjFOg" type="3010" element="_jirUoHA1EemKP426GDjFOg"> | ||
47 | <styles xmi:type="notation:FontStyle" xmi:id="_jitw4XA1EemKP426GDjFOg" fontColor="2697711" fontName="Segoe UI" fontHeight="8"/> | ||
48 | <layoutConstraint xmi:type="notation:Location" xmi:id="_jitw4nA1EemKP426GDjFOg"/> | ||
49 | </children> | ||
50 | <styles xmi:type="notation:SortingStyle" xmi:id="_X2A5MnA1EemKP426GDjFOg"/> | ||
51 | <styles xmi:type="notation:FilteringStyle" xmi:id="_X2A5M3A1EemKP426GDjFOg"/> | ||
52 | </children> | ||
53 | <styles xmi:type="notation:ShapeStyle" xmi:id="_X2ASIXA1EemKP426GDjFOg" fontName="Segoe UI" fontHeight="8"/> | ||
54 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_X2ASInA1EemKP426GDjFOg" x="690" y="180" width="120" height="100"/> | ||
55 | </children> | ||
56 | <styles xmi:type="notation:DiagramStyle" xmi:id="_TbTBaHA1EemKP426GDjFOg"/> | ||
57 | <edges xmi:type="notation:Edge" xmi:id="_ZZnZ8HA1EemKP426GDjFOg" type="4001" element="_ZZjvkHA1EemKP426GDjFOg" source="_Ur9YAHA1EemKP426GDjFOg" target="_X2ASIHA1EemKP426GDjFOg"> | ||
58 | <children xmi:type="notation:Node" xmi:id="_ZZnZ9HA1EemKP426GDjFOg" type="6001"> | ||
59 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZZnZ9XA1EemKP426GDjFOg" x="6" y="10"/> | ||
60 | </children> | ||
61 | <children xmi:type="notation:Node" xmi:id="_ZZnZ9nA1EemKP426GDjFOg" type="6002"> | ||
62 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZZnZ93A1EemKP426GDjFOg" x="1" y="10"/> | ||
63 | </children> | ||
64 | <children xmi:type="notation:Node" xmi:id="_ZZnZ-HA1EemKP426GDjFOg" type="6003"> | ||
65 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZZnZ-XA1EemKP426GDjFOg" x="-1" y="10"/> | ||
66 | </children> | ||
67 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_ZZnZ8XA1EemKP426GDjFOg" routing="Rectilinear"/> | ||
68 | <styles xmi:type="notation:FontStyle" xmi:id="_ZZnZ8nA1EemKP426GDjFOg" fontColor="7490599" fontName="Segoe UI" fontHeight="8"/> | ||
69 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_ZZnZ83A1EemKP426GDjFOg" points="[0, 0, -287, 4]$[143, 0, -144, 4]$[143, -4, -144, 0]$[287, -4, 0, 0]"/> | ||
70 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ZZnZ-nA1EemKP426GDjFOg" id="(1.0,0.5)"/> | ||
71 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ZZnZ-3A1EemKP426GDjFOg" id="(0.0,0.30612244897959184)"/> | ||
72 | </edges> | ||
73 | <edges xmi:type="notation:Edge" xmi:id="_f8gfMHA1EemKP426GDjFOg" type="4001" element="_f8eC8HA1EemKP426GDjFOg" source="_X2ASIHA1EemKP426GDjFOg" target="_X2ASIHA1EemKP426GDjFOg"> | ||
74 | <children xmi:type="notation:Node" xmi:id="_f8gfNHA1EemKP426GDjFOg" type="6001"> | ||
75 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_f8gfNXA1EemKP426GDjFOg" x="-8" y="7"/> | ||
76 | </children> | ||
77 | <children xmi:type="notation:Node" xmi:id="_f8hGQHA1EemKP426GDjFOg" type="6002"> | ||
78 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_f8hGQXA1EemKP426GDjFOg" x="12" y="10"/> | ||
79 | </children> | ||
80 | <children xmi:type="notation:Node" xmi:id="_f8hGQnA1EemKP426GDjFOg" type="6003"> | ||
81 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_f8hGQ3A1EemKP426GDjFOg" y="-10"/> | ||
82 | </children> | ||
83 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_f8gfMXA1EemKP426GDjFOg" routing="Rectilinear"/> | ||
84 | <styles xmi:type="notation:FontStyle" xmi:id="_f8gfMnA1EemKP426GDjFOg" fontColor="7490599" fontName="Segoe UI" fontHeight="8"/> | ||
85 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_f8gfM3A1EemKP426GDjFOg" points="[4, 1, 0, -21]$[51, 1, 47, -21]$[51, -53, 47, -75]$[-25, -53, -29, -75]$[-25, -8, -29, -30]"/> | ||
86 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_f8hGRHA1EemKP426GDjFOg" id="(0.9666666666666667,0.09)"/> | ||
87 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_f8hGRXA1EemKP426GDjFOg" id="(1.0,0.30612244897959184)"/> | ||
88 | </edges> | ||
89 | <edges xmi:type="notation:Edge" xmi:id="_eUOggHA6EemKP426GDjFOg" type="4001" element="_eULdMHA6EemKP426GDjFOg" source="_X2ASIHA1EemKP426GDjFOg" target="_X2ASIHA1EemKP426GDjFOg"> | ||
90 | <children xmi:type="notation:Node" xmi:id="_eUOghHA6EemKP426GDjFOg" type="6001"> | ||
91 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eUOghXA6EemKP426GDjFOg" y="-10"/> | ||
92 | </children> | ||
93 | <children xmi:type="notation:Node" xmi:id="_eUOghnA6EemKP426GDjFOg" type="6002"> | ||
94 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eUOgh3A6EemKP426GDjFOg" y="10"/> | ||
95 | </children> | ||
96 | <children xmi:type="notation:Node" xmi:id="_eUOgiHA6EemKP426GDjFOg" type="6003"> | ||
97 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eUOgiXA6EemKP426GDjFOg" y="10"/> | ||
98 | </children> | ||
99 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_eUOggXA6EemKP426GDjFOg" routing="Rectilinear"/> | ||
100 | <styles xmi:type="notation:FontStyle" xmi:id="_eUOggnA6EemKP426GDjFOg" fontName="Segoe UI" fontHeight="8"/> | ||
101 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_eUOgg3A6EemKP426GDjFOg" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> | ||
102 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_eUOginA6EemKP426GDjFOg" id="(0.5,0.5)"/> | ||
103 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_eUOgi3A6EemKP426GDjFOg" id="(0.5,0.5)"/> | ||
104 | </edges> | ||
105 | </data> | ||
106 | </ownedAnnotationEntries> | ||
107 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_Ur5GkHA1EemKP426GDjFOg" name="SocialNetwork" tooltipText="" outgoingEdges="_ZZjvkHA1EemKP426GDjFOg" width="12" height="10"> | ||
108 | <target xmi:type="ecore:EClass" href="socialnetwork.ecore#//SocialNetwork"/> | ||
109 | <semanticElements xmi:type="ecore:EClass" href="socialnetwork.ecore#//SocialNetwork"/> | ||
110 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_XY_mAHA1EemKP426GDjFOg" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
111 | <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> | ||
112 | </ownedStyle> | ||
113 | <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> | ||
114 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_W_DcAHA1EemKP426GDjFOg" name="name : EString" tooltipText=""> | ||
115 | <target xmi:type="ecore:EAttribute" href="socialnetwork.ecore#//SocialNetwork/name"/> | ||
116 | <semanticElements xmi:type="ecore:EAttribute" href="socialnetwork.ecore#//SocialNetwork/name"/> | ||
117 | <ownedStyle xmi:type="diagram:BundledImage" uid="_XZANEHA1EemKP426GDjFOg" labelAlignment="LEFT"> | ||
118 | <description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/> | ||
119 | </ownedStyle> | ||
120 | <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> | ||
121 | </ownedElements> | ||
122 | </ownedDiagramElements> | ||
123 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_X14WUHA1EemKP426GDjFOg" name="Person" tooltipText="" outgoingEdges="_f8eC8HA1EemKP426GDjFOg _eULdMHA6EemKP426GDjFOg" incomingEdges="_ZZjvkHA1EemKP426GDjFOg _f8eC8HA1EemKP426GDjFOg _eULdMHA6EemKP426GDjFOg" width="12" height="10"> | ||
124 | <target xmi:type="ecore:EClass" href="socialnetwork.ecore#//Person"/> | ||
125 | <semanticElements xmi:type="ecore:EClass" href="socialnetwork.ecore#//Person"/> | ||
126 | <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> | ||
127 | <arrangeConstraints>KEEP_SIZE</arrangeConstraints> | ||
128 | <arrangeConstraints>KEEP_RATIO</arrangeConstraints> | ||
129 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_kAhuQHA1EemKP426GDjFOg" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
130 | <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> | ||
131 | </ownedStyle> | ||
132 | <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> | ||
133 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_jirUoHA1EemKP426GDjFOg" name="name : EString" tooltipText=""> | ||
134 | <target xmi:type="ecore:EAttribute" href="socialnetwork.ecore#//Person/name"/> | ||
135 | <semanticElements xmi:type="ecore:EAttribute" href="socialnetwork.ecore#//Person/name"/> | ||
136 | <ownedStyle xmi:type="diagram:BundledImage" uid="_kAiVUHA1EemKP426GDjFOg" labelAlignment="LEFT"> | ||
137 | <description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/> | ||
138 | </ownedStyle> | ||
139 | <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> | ||
140 | </ownedElements> | ||
141 | </ownedDiagramElements> | ||
142 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_ZZjvkHA1EemKP426GDjFOg" name="[0..*] persons" sourceNode="_Ur5GkHA1EemKP426GDjFOg" targetNode="_X14WUHA1EemKP426GDjFOg"> | ||
143 | <target xmi:type="ecore:EReference" href="socialnetwork.ecore#//SocialNetwork/persons"/> | ||
144 | <semanticElements xmi:type="ecore:EReference" href="socialnetwork.ecore#//SocialNetwork/persons"/> | ||
145 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_ZZkWo3A1EemKP426GDjFOg" description="_ZZkWoHA1EemKP426GDjFOg" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
146 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_ZZkWpHA1EemKP426GDjFOg" showIcon="false"> | ||
147 | <customFeatures>labelSize</customFeatures> | ||
148 | </centerLabelStyle> | ||
149 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_ZZkWpXA1EemKP426GDjFOg" showIcon="false" labelColor="39,76,114"> | ||
150 | <customFeatures>labelSize</customFeatures> | ||
151 | </endLabelStyle> | ||
152 | </ownedStyle> | ||
153 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> | ||
154 | </ownedDiagramElements> | ||
155 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_f8eC8HA1EemKP426GDjFOg" name="[0..*] friends" sourceNode="_X14WUHA1EemKP426GDjFOg" targetNode="_X14WUHA1EemKP426GDjFOg"> | ||
156 | <target xmi:type="ecore:EReference" href="socialnetwork.ecore#//Person/friends"/> | ||
157 | <semanticElements xmi:type="ecore:EReference" href="socialnetwork.ecore#//Person/friends"/> | ||
158 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_erMusHA9EemKP426GDjFOg" routingStyle="manhattan" strokeColor="0,0,0"> | ||
159 | <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']/@style"/> | ||
160 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_erMusXA9EemKP426GDjFOg" showIcon="false"/> | ||
161 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_erMusnA9EemKP426GDjFOg" labelSize="6" showIcon="false" labelColor="39,76,114"/> | ||
162 | </ownedStyle> | ||
163 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> | ||
164 | </ownedDiagramElements> | ||
165 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_eULdMHA6EemKP426GDjFOg" sourceNode="_X14WUHA1EemKP426GDjFOg" targetNode="_X14WUHA1EemKP426GDjFOg" beginLabel="[0..*] children" endLabel="[0..2] parents"> | ||
166 | <target xmi:type="ecore:EReference" href="socialnetwork.ecore#//Person/parents"/> | ||
167 | <semanticElements xmi:type="ecore:EReference" href="socialnetwork.ecore#//Person/children"/> | ||
168 | <semanticElements xmi:type="ecore:EReference" href="socialnetwork.ecore#//Person/parents"/> | ||
169 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_eUMEQHA6EemKP426GDjFOg" sourceArrow="InputArrow" routingStyle="manhattan" strokeColor="0,0,0"> | ||
170 | <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']/@style"/> | ||
171 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_eUMEQXA6EemKP426GDjFOg" showIcon="false"/> | ||
172 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_eUMEQnA6EemKP426GDjFOg" showIcon="false"/> | ||
173 | </ownedStyle> | ||
174 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/> | ||
175 | </ownedDiagramElements> | ||
176 | <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> | ||
177 | <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_TbTBZHA1EemKP426GDjFOg"/> | ||
178 | <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/> | ||
179 | <activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@additionalLayers[name='Package']"/> | ||
180 | <activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@additionalLayers[name='Validation']"/> | ||
181 | <target xmi:type="ecore:EPackage" href="socialnetwork.ecore#/"/> | ||
182 | </diagram:DSemanticDiagram> | ||
183 | </xmi:XMI> | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.ecore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.ecore new file mode 100644 index 00000000..cacf9921 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.ecore | |||
@@ -0,0 +1,17 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="socialnetwork" nsURI="http://ecse.mcgill.ca/socialnetwork" nsPrefix="socialnetwork"> | ||
4 | <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"/> | ||
5 | <eClassifiers xsi:type="ecore:EClass" name="SocialNetwork"> | ||
6 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" | ||
7 | defaultValueLiteral="SocialNetwork"/> | ||
8 | <eStructuralFeatures xsi:type="ecore:EReference" name="persons" upperBound="-1" | ||
9 | eType="#//Person" containment="true"/> | ||
10 | </eClassifiers> | ||
11 | <eClassifiers xsi:type="ecore:EClass" name="Person"> | ||
12 | <eStructuralFeatures xsi:type="ecore:EReference" name="friends" upperBound="-1" | ||
13 | eType="#//Person"/> | ||
14 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" | ||
15 | defaultValueLiteral="Name"/> | ||
16 | </eClassifiers> | ||
17 | </ecore:EPackage> | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.genmodel b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.genmodel new file mode 100644 index 00000000..c9515653 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.genmodel | |||
@@ -0,0 +1,21 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" | ||
4 | modelDirectory="/SocialNetwork_plugin/encore_gen" creationIcons="false" | ||
5 | editDirectory="/ca.mcgill.ecse.socialnetwork.edit/src-gen" editorDirectory="/ca.mcgill.ecse.socialnetwork.editor/src-gen" | ||
6 | modelPluginID="SocialNetwork_plugin" modelName="Socialnetwork" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" | ||
7 | codeFormatting="true" importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" | ||
8 | copyrightFields="false" operationReflection="true" importOrganizing="true"> | ||
9 | <foreignModel>socialnetwork.ecore</foreignModel> | ||
10 | <testsDirectory xsi:nil="true"/> | ||
11 | <genPackages prefix="Socialnetwork" disposableProviderFactory="true" ecorePackage="socialnetwork.ecore#/"> | ||
12 | <genClasses ecoreClass="socialnetwork.ecore#//SocialNetwork"> | ||
13 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute socialnetwork.ecore#//SocialNetwork/name"/> | ||
14 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference socialnetwork.ecore#//SocialNetwork/persons"/> | ||
15 | </genClasses> | ||
16 | <genClasses ecoreClass="socialnetwork.ecore#//Person"> | ||
17 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference socialnetwork.ecore#//Person/friends"/> | ||
18 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute socialnetwork.ecore#//Person/name"/> | ||
19 | </genClasses> | ||
20 | </genPackages> | ||
21 | </genmodel:GenModel> | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/200_nodes.jpg b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/200_nodes.jpg new file mode 100644 index 00000000..a35c291b --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/200_nodes.jpg | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/220_nodes.jpg b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/220_nodes.jpg new file mode 100644 index 00000000..4d41dff7 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/220_nodes.jpg | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/260_nodes.jpg b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/260_nodes.jpg new file mode 100644 index 00000000..b16cdfb2 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/260_nodes.jpg | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/280_nodes.jpg b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/280_nodes.jpg new file mode 100644 index 00000000..16c0ee23 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/280_nodes.jpg | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/output.txt b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/output.txt new file mode 100644 index 00000000..35158e20 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/output.txt | |||
@@ -0,0 +1,300 @@ | |||
1 | 1 | ||
2 | 9 | ||
3 | 7 | ||
4 | 0 | ||
5 | 4 | ||
6 | 6 | ||
7 | 16 | ||
8 | 0 | ||
9 | 2 | ||
10 | 4 | ||
11 | 17 | ||
12 | 20 | ||
13 | 1 | ||
14 | 5 | ||
15 | 2 | ||
16 | 3 | ||
17 | 11 | ||
18 | 6 | ||
19 | 4 | ||
20 | 0 | ||
21 | 2 | ||
22 | 1 | ||
23 | 3 | ||
24 | 5 | ||
25 | 9 | ||
26 | 13 | ||
27 | 11 | ||
28 | 0 | ||
29 | 1 | ||
30 | 10 | ||
31 | 3 | ||
32 | 0 | ||
33 | 1 | ||
34 | 1 | ||
35 | 0 | ||
36 | 17 | ||
37 | 0 | ||
38 | 4 | ||
39 | 2 | ||
40 | 0 | ||
41 | 1 | ||
42 | 10 | ||
43 | 10 | ||
44 | 0 | ||
45 | 24 | ||
46 | 9 | ||
47 | 0 | ||
48 | 14 | ||
49 | 1 | ||
50 | 11 | ||
51 | 2 | ||
52 | 17 | ||
53 | 3 | ||
54 | 3 | ||
55 | 3 | ||
56 | 0 | ||
57 | 3 | ||
58 | 1 | ||
59 | 3 | ||
60 | 2 | ||
61 | 2 | ||
62 | 1 | ||
63 | 0 | ||
64 | 3 | ||
65 | 6 | ||
66 | 3 | ||
67 | 16 | ||
68 | 3 | ||
69 | 10 | ||
70 | 6 | ||
71 | 6 | ||
72 | 6 | ||
73 | 11 | ||
74 | 6 | ||
75 | 10 | ||
76 | 20 | ||
77 | 1 | ||
78 | 4 | ||
79 | 13 | ||
80 | 0 | ||
81 | 0 | ||
82 | 3 | ||
83 | 2 | ||
84 | 0 | ||
85 | 12 | ||
86 | 0 | ||
87 | 0 | ||
88 | 22 | ||
89 | 4 | ||
90 | 0 | ||
91 | 0 | ||
92 | 20 | ||
93 | 1 | ||
94 | 10 | ||
95 | 9 | ||
96 | 11 | ||
97 | 5 | ||
98 | 27 | ||
99 | 1 | ||
100 | 3 | ||
101 | 9 | ||
102 | 0 | ||
103 | 23 | ||
104 | 10 | ||
105 | 9 | ||
106 | 23 | ||
107 | 0 | ||
108 | 3 | ||
109 | 7 | ||
110 | 2 | ||
111 | 0 | ||
112 | 9 | ||
113 | 3 | ||
114 | 0 | ||
115 | 12 | ||
116 | 11 | ||
117 | 7 | ||
118 | 6 | ||
119 | 9 | ||
120 | 2 | ||
121 | 0 | ||
122 | 3 | ||
123 | 4 | ||
124 | 3 | ||
125 | 9 | ||
126 | 3 | ||
127 | 0 | ||
128 | 7 | ||
129 | 2 | ||
130 | 1 | ||
131 | 9 | ||
132 | 1 | ||
133 | 11 | ||
134 | 6 | ||
135 | 5 | ||
136 | 16 | ||
137 | 0 | ||
138 | 19 | ||
139 | 14 | ||
140 | 9 | ||
141 | 13 | ||
142 | 2 | ||
143 | 8 | ||
144 | 0 | ||
145 | 6 | ||
146 | 1 | ||
147 | 1 | ||
148 | 2 | ||
149 | 0 | ||
150 | 3 | ||
151 | 15 | ||
152 | 3 | ||
153 | 0 | ||
154 | 3 | ||
155 | 17 | ||
156 | 1 | ||
157 | 15 | ||
158 | 5 | ||
159 | 1 | ||
160 | 21 | ||
161 | 8 | ||
162 | 2 | ||
163 | 7 | ||
164 | 3 | ||
165 | 16 | ||
166 | 11 | ||
167 | 1 | ||
168 | 5 | ||
169 | 1 | ||
170 | 5 | ||
171 | 1 | ||
172 | 6 | ||
173 | 3 | ||
174 | 16 | ||
175 | 6 | ||
176 | 17 | ||
177 | 3 | ||
178 | 5 | ||
179 | 7 | ||
180 | 2 | ||
181 | 9 | ||
182 | 2 | ||
183 | 1 | ||
184 | 11 | ||
185 | 1 | ||
186 | 0 | ||
187 | 3 | ||
188 | 5 | ||
189 | 6 | ||
190 | 2 | ||
191 | 5 | ||
192 | 1 | ||
193 | 4 | ||
194 | 9 | ||
195 | 0 | ||
196 | 11 | ||
197 | 1 | ||
198 | 10 | ||
199 | 13 | ||
200 | 6 | ||
201 | 2 | ||
202 | 1 | ||
203 | 3 | ||
204 | 4 | ||
205 | 0 | ||
206 | 1 | ||
207 | 2 | ||
208 | 10 | ||
209 | 12 | ||
210 | 3 | ||
211 | 3 | ||
212 | 3 | ||
213 | 0 | ||
214 | 2 | ||
215 | 4 | ||
216 | 2 | ||
217 | 18 | ||
218 | 3 | ||
219 | 8 | ||
220 | 7 | ||
221 | 5 | ||
222 | 3 | ||
223 | 16 | ||
224 | 1 | ||
225 | 4 | ||
226 | 8 | ||
227 | 15 | ||
228 | 1 | ||
229 | 11 | ||
230 | 15 | ||
231 | 1 | ||
232 | 8 | ||
233 | 7 | ||
234 | 1 | ||
235 | 2 | ||
236 | 0 | ||
237 | 9 | ||
238 | 5 | ||
239 | 2 | ||
240 | 1 | ||
241 | 3 | ||
242 | 6 | ||
243 | 4 | ||
244 | 8 | ||
245 | 3 | ||
246 | 12 | ||
247 | 4 | ||
248 | 21 | ||
249 | 9 | ||
250 | 2 | ||
251 | 3 | ||
252 | 2 | ||
253 | 1 | ||
254 | 3 | ||
255 | 11 | ||
256 | 2 | ||
257 | 9 | ||
258 | 0 | ||
259 | 10 | ||
260 | 6 | ||
261 | 1 | ||
262 | 2 | ||
263 | 0 | ||
264 | 8 | ||
265 | 5 | ||
266 | 2 | ||
267 | 3 | ||
268 | 8 | ||
269 | 1 | ||
270 | 13 | ||
271 | 8 | ||
272 | 2 | ||
273 | 2 | ||
274 | 11 | ||
275 | 4 | ||
276 | 21 | ||
277 | 6 | ||
278 | 5 | ||
279 | 0 | ||
280 | 8 | ||
281 | 8 | ||
282 | 12 | ||
283 | 0 | ||
284 | 0 | ||
285 | 4 | ||
286 | 1 | ||
287 | 19 | ||
288 | 5 | ||
289 | 3 | ||
290 | 1 | ||
291 | 3 | ||
292 | 12 | ||
293 | 2 | ||
294 | 6 | ||
295 | 11 | ||
296 | 8 | ||
297 | 8 | ||
298 | 2 | ||
299 | 18 | ||
300 | 0 | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/plot_distribution.m b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/plot_distribution.m new file mode 100644 index 00000000..4c67a191 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/plot_distribution.m | |||
@@ -0,0 +1,11 @@ | |||
1 | clear; | ||
2 | clc; | ||
3 | |||
4 | matrix = load('-ascii', "output.txt"); | ||
5 | hist(matrix,unique(matrix)); | ||
6 | hold on; | ||
7 | [a,b] = hist(matrix,unique(matrix)) | ||
8 | plot(b, a) | ||
9 | hold off; | ||
10 | sum(matrix) | ||
11 | average = sum(matrix) / length(matrix) \ No newline at end of file | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/output.txt b/Metrics/Metrics-Calculation/SocialNetwork_plugin/output.txt new file mode 100644 index 00000000..f027494d --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/output.txt | |||
@@ -0,0 +1,9 @@ | |||
1 | 1 | ||
2 | 3 | ||
3 | 1 | ||
4 | 3 | ||
5 | 3 | ||
6 | 5 | ||
7 | 3 | ||
8 | 1 | ||
9 | 2 | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/output/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/output/.gitignore new file mode 100644 index 00000000..17126b28 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/output/.gitignore | |||
@@ -0,0 +1,4 @@ | |||
1 | # ignore everything in this folder except for this folder it self | ||
2 | |||
3 | * | ||
4 | !.gitignore \ No newline at end of file | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/plugin.properties b/Metrics/Metrics-Calculation/SocialNetwork_plugin/plugin.properties new file mode 100644 index 00000000..a6a0df71 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/plugin.properties | |||
@@ -0,0 +1,4 @@ | |||
1 | # | ||
2 | |||
3 | pluginName = SocialNetwork_plugin | ||
4 | providerName = www.example.org | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/plugin.xml b/Metrics/Metrics-Calculation/SocialNetwork_plugin/plugin.xml new file mode 100644 index 00000000..6f4ab31b --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/plugin.xml | |||
@@ -0,0 +1,15 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?><?eclipse version="3.0"?><!-- | ||
2 | --><plugin> | ||
3 | <extension point="org.eclipse.emf.ecore.generated_package"> | ||
4 | <!-- @generated socialnetwork --> | ||
5 | <package class="socialnetwork.SocialnetworkPackage" genModel="model/socialnetwork.genmodel" uri="http://ecse.mcgill.ca/socialnetwork"/> | ||
6 | </extension> | ||
7 | <extension id="ca.mcgill.ecse.socialnetwork.plugin.Queries" point="org.eclipse.viatra.query.runtime.queryspecification"> | ||
8 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:ca.mcgill.ecse.socialnetwork.plugin.Queries" id="ca.mcgill.ecse.socialnetwork.plugin.Queries"> | ||
9 | <query-specification fqn="ca.mcgill.ecse.socialnetwork.plugin.singleFriendship"/> | ||
10 | <query-specification fqn="ca.mcgill.ecse.socialnetwork.plugin.noFriend"/> | ||
11 | <query-specification fqn="ca.mcgill.ecse.socialnetwork.plugin.selfFriend"/> | ||
12 | <query-specification fqn="ca.mcgill.ecse.socialnetwork.plugin.friendship"/> | ||
13 | </group> | ||
14 | </extension> | ||
15 | </plugin> | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/ca/mcgill/ecse/socialnetwork/plugin/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/ca/mcgill/ecse/socialnetwork/plugin/.gitignore new file mode 100644 index 00000000..f2558cf5 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/ca/mcgill/ecse/socialnetwork/plugin/.gitignore | |||
@@ -0,0 +1,10 @@ | |||
1 | /.Friendship.java._trace | ||
2 | /.NoFriend.java._trace | ||
3 | /.Queries.java._trace | ||
4 | /.SelfFriend.java._trace | ||
5 | /.SingleFriendship.java._trace | ||
6 | /Friendship.java | ||
7 | /NoFriend.java | ||
8 | /Queries.java | ||
9 | /SelfFriend.java | ||
10 | /SingleFriendship.java | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql new file mode 100644 index 00000000..3e7fc68c --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql | |||
@@ -0,0 +1,54 @@ | |||
1 | package ca.mcgill.ecse.socialnetwork.plugin | ||
2 | |||
3 | import epackage "http://ecse.mcgill.ca/socialnetwork" | ||
4 | |||
5 | //@Constraint(message="terminatorAndInformation", severity="error", key={T}) | ||
6 | //pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { | ||
7 | // FunctionalOutput.outgoingLinks(Out,I); | ||
8 | // FunctionalOutput.terminator(Out,T); | ||
9 | //} or { | ||
10 | // InformationLink.to(I,In); | ||
11 | // FunctionalInput.terminator(In,T); | ||
12 | //} | ||
13 | |||
14 | @Constraint(message="singleFriendship", severity="error", key={p1}) | ||
15 | pattern singleFriendship(p1: Person) { | ||
16 | find friendship(p1, p); | ||
17 | neg find friendship(p, p1); | ||
18 | } | ||
19 | |||
20 | //@Constraint(message="cycle", severity="error", key={p}) | ||
21 | //pattern cycleInParenthood(p: Person) { | ||
22 | // find isAncestor(p, p); | ||
23 | //} | ||
24 | |||
25 | @Constraint(message="noFriend", severity="error", key={p}) | ||
26 | pattern noFriend(p: Person){ | ||
27 | neg find friendship(p, _); | ||
28 | } | ||
29 | |||
30 | //@Constraint(message="brothhoodParent", severity="error", key={p1,p2}) | ||
31 | //pattern brothhoodParent(p1: Person, p2: Person){ | ||
32 | // Person.parents(p1, parent1); | ||
33 | // Person.parents(p2, parent2); | ||
34 | // parent1 == parent2; | ||
35 | // find isAncestor(p1, p2); | ||
36 | //} | ||
37 | @Constraint(message="selfFriend", severity="error", key={p}) | ||
38 | pattern selfFriend(p: Person){ | ||
39 | Person.friends(p,p); | ||
40 | } | ||
41 | |||
42 | pattern friendship(p1: Person, p2: Person){ | ||
43 | Person.friends(p1,p2); | ||
44 | } | ||
45 | |||
46 | //pattern isAncestor(person : Person, ancestor : Person){ | ||
47 | // Person.parents(person, ancestor); | ||
48 | //} or { | ||
49 | // Person.parents(person, parent); | ||
50 | // find isAncestor(parent, ancestor); | ||
51 | //} | ||
52 | |||
53 | |||
54 | |||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/Main.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/Main.java new file mode 100644 index 00000000..72ea45d1 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/Main.java | |||
@@ -0,0 +1,128 @@ | |||
1 | package ca.mcgill.ecse.socialnetwork.runner; | ||
2 | |||
3 | import java.io.File; | ||
4 | import java.io.FileNotFoundException; | ||
5 | import java.io.PrintStream; | ||
6 | import java.util.ArrayList; | ||
7 | |||
8 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app.Domain; | ||
9 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance.KSDistance; | ||
10 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.EMFGraph; | ||
11 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.CsvFileWriter; | ||
12 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.GraphReader; | ||
13 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup; | ||
14 | import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor; | ||
15 | import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.validation.ViolationCheck; | ||
16 | import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.YakindummPackage; | ||
17 | import socialnetwork.Person; | ||
18 | |||
19 | public class Main { | ||
20 | |||
21 | private static String runWithPath(String path) { | ||
22 | String message = StandaloneScriptExecutor.executeScript(path); | ||
23 | return message; | ||
24 | } | ||
25 | |||
26 | public static void main(String args[]) { | ||
27 | // try { | ||
28 | |||
29 | ArrayList<ArrayList<String>> output = new ArrayList<ArrayList<String>>(); | ||
30 | output.add(prepareInfo()); | ||
31 | CsvFileWriter.write(output, "yakinduum/info.csv"); | ||
32 | //YakinduumModel.init(); | ||
33 | generateModel(1); | ||
34 | // }catch(Exception e) { | ||
35 | // e.printStackTrace(); | ||
36 | // }finally { | ||
37 | // outDegreeStatistic(); | ||
38 | // } | ||
39 | // outDegreeStatistic(); | ||
40 | |||
41 | } | ||
42 | |||
43 | public static void generateModel(int run) { | ||
44 | //prepare initial info | ||
45 | long begin = System.currentTimeMillis(); | ||
46 | String message = runWithPath("yakinduGeneration.vsconfig"); | ||
47 | |||
48 | |||
49 | |||
50 | if(message == null) { | ||
51 | ArrayList<ArrayList<String>> output = new ArrayList<ArrayList<String>>(); | ||
52 | long elapsed = System.currentTimeMillis() - begin; | ||
53 | String time = formatTime(elapsed); | ||
54 | |||
55 | ArrayList<String> infoOutput = new ArrayList<String>(); | ||
56 | infoOutput.add(run+ ""); | ||
57 | infoOutput.add(time); | ||
58 | infoOutput.addAll(calculateMetric()); | ||
59 | |||
60 | YakinduumModel model = new YakinduumModel("output/Viatra_100/1.xmi"); | ||
61 | int violationCount = ViolationCheck.calculateViolationCounts(model.yakinduum); | ||
62 | infoOutput.add(violationCount + ""); | ||
63 | |||
64 | //save model to another directory | ||
65 | model.save("yakinduum/" + run + ".xmi"); | ||
66 | |||
67 | output.add(infoOutput); | ||
68 | CsvFileWriter.append(output, "yakinduum/info.csv"); | ||
69 | System.out.println("Finished"); | ||
70 | } | ||
71 | |||
72 | } | ||
73 | |||
74 | public static ArrayList<String> calculateMetric() { | ||
75 | //read model and metric | ||
76 | ArrayList<String> output = new ArrayList<String>(); | ||
77 | GraphReader reader = new GraphReader(YakindummPackage.eINSTANCE); | ||
78 | EMFGraph graph = reader.readModels("output/Viatra_100/").get(0); | ||
79 | |||
80 | //KS distance | ||
81 | KSDistance ks = new KSDistance(Domain.Yakinduum); | ||
82 | |||
83 | //calculate and put metric data to output array | ||
84 | MetricSampleGroup samples = graph.evaluateAllMetricsToSamples(); | ||
85 | output.add(graph.getStatistic().getAllNodes().size() + ""); | ||
86 | output.add(ks.outDegreeDistance(samples.outDegreeSamples) + ""); | ||
87 | output.add(ks.naDistance(samples.naSamples)+ ""); | ||
88 | output.add(ks.mpcDistance(samples.mpcSamples) + ""); | ||
89 | return output; | ||
90 | } | ||
91 | |||
92 | public static ArrayList<String> prepareInfo() { | ||
93 | ArrayList<String> info = new ArrayList<String>(); | ||
94 | info.add("ID"); | ||
95 | info.add("Time"); | ||
96 | info.add("# of Nodes"); | ||
97 | info.add("Out Degree"); | ||
98 | info.add("Node Activity"); | ||
99 | info.add("MPC"); | ||
100 | info.add("Violations"); | ||
101 | return info; | ||
102 | } | ||
103 | |||
104 | public static String formatTime(long time) { | ||
105 | long mili = time % 1000; | ||
106 | long second = (time / 1000) % 60; | ||
107 | long minute = (time / (1000 * 60)); | ||
108 | return String.format("%d : %d.%d", minute, second, mili); | ||
109 | } | ||
110 | |||
111 | public static void statistics() { | ||
112 | String uri = "output/1.xmi"; | ||
113 | SocialNetworkModel socialNetwork = new SocialNetworkModel(uri); | ||
114 | System.out.println(socialNetwork.getPersons().size()); | ||
115 | |||
116 | File file = new File("model/statistics/output.txt"); | ||
117 | try { | ||
118 | @SuppressWarnings("resource") | ||
119 | PrintStream out = new PrintStream(file); | ||
120 | for(Person p : socialNetwork.getPersons()) { | ||
121 | out.println(p.getFriends().size()); | ||
122 | } | ||
123 | } catch (FileNotFoundException e) { | ||
124 | e.printStackTrace(); | ||
125 | } | ||
126 | System.out.println("Output Finished"); | ||
127 | } | ||
128 | } | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/Persisitence.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/Persisitence.java new file mode 100644 index 00000000..3ebede25 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/Persisitence.java | |||
@@ -0,0 +1,63 @@ | |||
1 | package ca.mcgill.ecse.socialnetwork.runner; | ||
2 | import java.io.IOException; | ||
3 | import java.util.Collections; | ||
4 | import java.util.Map; | ||
5 | |||
6 | import org.eclipse.emf.common.util.URI; | ||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | import org.eclipse.emf.ecore.resource.Resource; | ||
9 | import org.eclipse.emf.ecore.resource.ResourceSet; | ||
10 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; | ||
11 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; | ||
12 | |||
13 | public class Persisitence<G extends EObject> { | ||
14 | private String uri; | ||
15 | |||
16 | public Persisitence (String suffix, String uri){ | ||
17 | //prepare to save | ||
18 | Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; | ||
19 | Map<String, Object> m = reg.getExtensionToFactoryMap(); | ||
20 | m.put(suffix, new XMIResourceFactoryImpl()); | ||
21 | this.uri = uri; | ||
22 | } | ||
23 | |||
24 | |||
25 | /** | ||
26 | * Save the model | ||
27 | * @return whether the model has saved successfully | ||
28 | */ | ||
29 | public boolean save(G model) { | ||
30 | //create resource | ||
31 | ResourceSet resSet = new ResourceSetImpl(); | ||
32 | Resource resource = resSet.createResource(URI.createURI(uri)); | ||
33 | resource.getContents().add(model); | ||
34 | try { | ||
35 | resource.save(Collections.EMPTY_MAP); | ||
36 | return true; | ||
37 | }catch(IOException e) { | ||
38 | e.printStackTrace(); | ||
39 | return false; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * load the model from persistent | ||
45 | * @return: the model loaded | ||
46 | */ | ||
47 | @SuppressWarnings("unchecked") | ||
48 | public G load() { | ||
49 | G model = null; | ||
50 | // try { | ||
51 | ResourceSet resSet = new ResourceSetImpl(); | ||
52 | Resource resource = resSet.getResource(URI.createURI(uri), true); | ||
53 | model = (G) resource.getContents().get(0); | ||
54 | // }catch (org.eclipse.emf.common.util.WrappedException e) { | ||
55 | // // if the file cannot be found then return null | ||
56 | // if(e.getCause().getClass() == java.io.FileNotFoundException.class) { | ||
57 | // return null; | ||
58 | // } | ||
59 | // } | ||
60 | |||
61 | return model; | ||
62 | } | ||
63 | } | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/RunnerTests.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/RunnerTests.java new file mode 100644 index 00000000..c09c55be --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/RunnerTests.java | |||
@@ -0,0 +1,18 @@ | |||
1 | package ca.mcgill.ecse.socialnetwork.runner; | ||
2 | |||
3 | import org.junit.Test; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor; | ||
6 | |||
7 | public class RunnerTests { | ||
8 | private static String runWithPath(String path) { | ||
9 | String message = StandaloneScriptExecutor.executeScript(path); | ||
10 | return message; | ||
11 | } | ||
12 | |||
13 | @Test | ||
14 | public void generateModel() { | ||
15 | String message = runWithPath("SocialNetworkGeneration.vsconfig"); | ||
16 | System.out.println(message); | ||
17 | } | ||
18 | } | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/SocialNetworkModel.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/SocialNetworkModel.java new file mode 100644 index 00000000..51c50b11 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/SocialNetworkModel.java | |||
@@ -0,0 +1,62 @@ | |||
1 | package ca.mcgill.ecse.socialnetwork.runner; | ||
2 | |||
3 | import org.eclipse.emf.common.util.EList; | ||
4 | |||
5 | import socialnetwork.Person; | ||
6 | import socialnetwork.SocialNetwork; | ||
7 | import socialnetwork.SocialnetworkFactory; | ||
8 | import socialnetwork.SocialnetworkPackage; | ||
9 | import socialnetwork.impl.SocialnetworkFactoryImpl; | ||
10 | |||
11 | |||
12 | |||
13 | public class SocialNetworkModel { | ||
14 | private final static String SUFFIX = "xmi"; | ||
15 | |||
16 | private static boolean isInit = false; | ||
17 | |||
18 | public static void init() { | ||
19 | SocialnetworkFactory.eINSTANCE.eClass(); | ||
20 | SocialnetworkPackage.eINSTANCE.eClass(); | ||
21 | SocialnetworkFactoryImpl.init(); | ||
22 | } | ||
23 | |||
24 | // container for the social network model | ||
25 | public SocialNetwork socialNetwork; | ||
26 | |||
27 | // factory for social network model | ||
28 | SocialnetworkFactory factory; | ||
29 | |||
30 | // persistent | ||
31 | Persisitence<SocialNetwork> persistence; | ||
32 | |||
33 | |||
34 | public SocialNetworkModel(String uri){ | ||
35 | if(!isInit) { | ||
36 | init(); | ||
37 | } | ||
38 | |||
39 | //create persistence | ||
40 | persistence = new Persisitence<SocialNetwork>(SUFFIX, uri); | ||
41 | factory = SocialnetworkFactory.eINSTANCE; | ||
42 | // try load the model | ||
43 | this.socialNetwork = persistence.load(); | ||
44 | if(this.socialNetwork == null) { | ||
45 | this.socialNetwork = factory.createSocialNetwork(); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | public Person createPerson() { | ||
50 | Person p = factory.createPerson(); | ||
51 | socialNetwork.getPersons().add(p); | ||
52 | return p; | ||
53 | } | ||
54 | |||
55 | public EList<Person> getPersons(){ | ||
56 | return socialNetwork.getPersons(); | ||
57 | } | ||
58 | |||
59 | public boolean save() { | ||
60 | return persistence.save(socialNetwork); | ||
61 | } | ||
62 | } | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/YakinduumModel.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/YakinduumModel.java new file mode 100644 index 00000000..803daff4 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/YakinduumModel.java | |||
@@ -0,0 +1,52 @@ | |||
1 | package ca.mcgill.ecse.socialnetwork.runner; | ||
2 | |||
3 | import javax.annotation.Resource; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.Statechart; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.YakindummFactory; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.YakindummPackage; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl.YakindummFactoryImpl; | ||
9 | import socialnetwork.SocialNetwork; | ||
10 | import socialnetwork.SocialnetworkFactory; | ||
11 | |||
12 | public class YakinduumModel { | ||
13 | private final static String SUFFIX = "xmi"; | ||
14 | |||
15 | private static boolean isInit = false; | ||
16 | |||
17 | private String uri; | ||
18 | |||
19 | public static void init() { | ||
20 | YakindummFactory.eINSTANCE.eClass(); | ||
21 | YakindummPackage.eINSTANCE.eClass(); | ||
22 | YakindummFactoryImpl.init(); | ||
23 | } | ||
24 | |||
25 | // container for the social network model | ||
26 | public Statechart yakinduum; | ||
27 | |||
28 | |||
29 | // persistent | ||
30 | Persisitence<Statechart> persistence; | ||
31 | |||
32 | |||
33 | public YakinduumModel(String uri){ | ||
34 | if(!isInit) { | ||
35 | init(); | ||
36 | } | ||
37 | this.uri = uri; | ||
38 | //create persistence | ||
39 | persistence = new Persisitence<Statechart>(SUFFIX, uri); | ||
40 | // try load the model | ||
41 | this.yakinduum = persistence.load(); | ||
42 | } | ||
43 | |||
44 | public boolean save(String uri) { | ||
45 | if(this.uri.equals(uri)) { | ||
46 | return persistence.save(yakinduum); | ||
47 | }else { | ||
48 | persistence = new Persisitence<Statechart>(SUFFIX, uri); | ||
49 | return persistence.save(yakinduum); | ||
50 | } | ||
51 | } | ||
52 | } | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduGeneration.vsconfig b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduGeneration.vsconfig new file mode 100644 index 00000000..cf08c562 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduGeneration.vsconfig | |||
@@ -0,0 +1,23 @@ | |||
1 | import epackage "../VIATRA-Generator/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/model/yakindu_simplified.ecore" | ||
2 | import viatra "../VIATRA-Generator/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql" | ||
3 | |||
4 | generate { | ||
5 | metamodel = { package yakindumm excluding { Synchronization}} | ||
6 | constraints = { package hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu } | ||
7 | partial-model = { "inputs/start.xmi"} | ||
8 | |||
9 | solver = ViatraSolver | ||
10 | |||
11 | scope = { | ||
12 | #node = 100 | ||
13 | } | ||
14 | |||
15 | number = 1 | ||
16 | runs = 1 | ||
17 | config = { | ||
18 | log-level = none | ||
19 | } | ||
20 | |||
21 | debug = "debug" | ||
22 | output = "output/Viatra_100/" | ||
23 | } \ No newline at end of file | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/1.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/1.xmi new file mode 100644 index 00000000..6bee747f --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/1.xmi | |||
@@ -0,0 +1,130 @@ | |||
1 | <?xml version="1.0" encoding="ASCII"?> | ||
2 | <hu.bme.mit.inf.yakindumm:Statechart xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hu.bme.mit.inf.yakindumm="hu.bme.mit.inf.yakindumm"> | ||
3 | <regions> | ||
4 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:FinalState" incomingTransitions="//@regions.0/@vertices.3/@regions.0/@vertices.2/@outgoingTransitions.1"/> | ||
5 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Exit" incomingTransitions="//@regions.0/@vertices.3/@regions.1/@vertices.1/@outgoingTransitions.5 //@regions.0/@vertices.3/@regions.1/@vertices.1/@outgoingTransitions.7"> | ||
6 | <outgoingTransitions target="//@regions.0/@vertices.3"/> | ||
7 | </vertices> | ||
8 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Exit" incomingTransitions="//@regions.1/@vertices.5/@outgoingTransitions.0 //@regions.0/@vertices.5/@regions.0/@vertices.0/@outgoingTransitions.1 //@regions.0/@vertices.3/@regions.0/@vertices.7/@outgoingTransitions.2"/> | ||
9 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.5/@regions.0/@vertices.0/@outgoingTransitions.0 //@regions.0/@vertices.3/@outgoingTransitions.4 //@regions.0/@vertices.1/@outgoingTransitions.0 //@regions.0/@vertices.3/@regions.1/@vertices.1/@outgoingTransitions.4"> | ||
10 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.1/@vertices.1"/> | ||
11 | <outgoingTransitions target="//@regions.0/@vertices.5"/> | ||
12 | <outgoingTransitions target="//@regions.0/@vertices.5"/> | ||
13 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.0"/> | ||
14 | <outgoingTransitions target="//@regions.0/@vertices.3"/> | ||
15 | <outgoingTransitions target="//@regions.1/@vertices.1"/> | ||
16 | <regions> | ||
17 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:FinalState" incomingTransitions="//@regions.0/@vertices.3/@regions.0/@vertices.5/@outgoingTransitions.0 //@regions.0/@vertices.3/@outgoingTransitions.3"> | ||
18 | <outgoingTransitions target="//@regions.1/@vertices.3"/> | ||
19 | </vertices> | ||
20 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.3/@regions.1/@vertices.3/@outgoingTransitions.1"> | ||
21 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.1/@vertices.1"/> | ||
22 | <outgoingTransitions target="//@regions.0/@vertices.5/@regions.0/@vertices.4"/> | ||
23 | </vertices> | ||
24 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.3/@regions.0/@vertices.2/@outgoingTransitions.0"> | ||
25 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.2"/> | ||
26 | <outgoingTransitions target="//@regions.0/@vertices.0"/> | ||
27 | </vertices> | ||
28 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Entry"> | ||
29 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.5"/> | ||
30 | </vertices> | ||
31 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State"/> | ||
32 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.3/@regions.0/@vertices.5/@outgoingTransitions.1 //@regions.0/@vertices.3/@regions.0/@vertices.3/@outgoingTransitions.0"> | ||
33 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.0"/> | ||
34 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.5"/> | ||
35 | <outgoingTransitions target="//@regions.0/@vertices.5"/> | ||
36 | <outgoingTransitions target="//@regions.1/@vertices.3"/> | ||
37 | </vertices> | ||
38 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:FinalState" incomingTransitions="//@regions.0/@vertices.5/@outgoingTransitions.1 //@regions.0/@vertices.5/@regions.0/@vertices.4/@outgoingTransitions.2"/> | ||
39 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.1/@vertices.0/@outgoingTransitions.0 //@regions.0/@vertices.3/@regions.0/@vertices.7/@outgoingTransitions.1"> | ||
40 | <outgoingTransitions target="//@regions.1/@vertices.0"/> | ||
41 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.7"/> | ||
42 | <outgoingTransitions target="//@regions.0/@vertices.2"/> | ||
43 | </vertices> | ||
44 | </regions> | ||
45 | <regions> | ||
46 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.3/@regions.1/@vertices.0/@outgoingTransitions.0"> | ||
47 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.1/@vertices.0"/> | ||
48 | </vertices> | ||
49 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.3/@regions.0/@vertices.1/@outgoingTransitions.0 //@regions.0/@vertices.3/@regions.1/@vertices.1/@outgoingTransitions.1 //@regions.0/@vertices.3/@outgoingTransitions.0 //@regions.0/@vertices.3/@regions.1/@vertices.2/@outgoingTransitions.0 //@regions.1/@vertices.8/@outgoingTransitions.1"> | ||
50 | <outgoingTransitions target="//@regions.0/@vertices.4"/> | ||
51 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.1/@vertices.1"/> | ||
52 | <outgoingTransitions target="//@regions.0/@vertices.5/@regions.0/@vertices.5"/> | ||
53 | <outgoingTransitions target="//@regions.1/@vertices.7"/> | ||
54 | <outgoingTransitions target="//@regions.0/@vertices.3"/> | ||
55 | <outgoingTransitions target="//@regions.0/@vertices.1"/> | ||
56 | <outgoingTransitions target="//@regions.1/@vertices.6"/> | ||
57 | <outgoingTransitions target="//@regions.0/@vertices.1"/> | ||
58 | </vertices> | ||
59 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Entry"> | ||
60 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.1/@vertices.1"/> | ||
61 | </vertices> | ||
62 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.3/@regions.1/@vertices.3/@outgoingTransitions.0"> | ||
63 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.1/@vertices.3"/> | ||
64 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.1"/> | ||
65 | </vertices> | ||
66 | </regions> | ||
67 | </vertices> | ||
68 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.3/@regions.1/@vertices.1/@outgoingTransitions.0 //@regions.0/@vertices.5/@outgoingTransitions.3"> | ||
69 | <outgoingTransitions target="//@regions.0/@vertices.6"/> | ||
70 | </vertices> | ||
71 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.3/@regions.0/@vertices.5/@outgoingTransitions.2 //@regions.0/@vertices.3/@outgoingTransitions.1 //@regions.0/@vertices.3/@outgoingTransitions.2 //@regions.0/@vertices.5/@outgoingTransitions.2 //@regions.1/@vertices.2/@outgoingTransitions.0"> | ||
72 | <outgoingTransitions target="//@regions.1/@vertices.2"/> | ||
73 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.6"/> | ||
74 | <outgoingTransitions target="//@regions.0/@vertices.5"/> | ||
75 | <outgoingTransitions target="//@regions.0/@vertices.4"/> | ||
76 | <regions> | ||
77 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.1/@vertices.4/@outgoingTransitions.0 //@regions.0/@vertices.5/@regions.0/@vertices.0/@outgoingTransitions.2"> | ||
78 | <outgoingTransitions target="//@regions.0/@vertices.3"/> | ||
79 | <outgoingTransitions target="//@regions.0/@vertices.2"/> | ||
80 | <outgoingTransitions target="//@regions.0/@vertices.5/@regions.0/@vertices.0"/> | ||
81 | <outgoingTransitions target="//@regions.0/@vertices.5/@regions.0/@vertices.5"/> | ||
82 | </vertices> | ||
83 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Exit" incomingTransitions="//@regions.1/@vertices.8/@outgoingTransitions.0"/> | ||
84 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Entry"> | ||
85 | <outgoingTransitions/> | ||
86 | </vertices> | ||
87 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.5/@regions.0/@vertices.3/@outgoingTransitions.1"> | ||
88 | <outgoingTransitions target="//@regions.1/@vertices.0"/> | ||
89 | <outgoingTransitions target="//@regions.0/@vertices.5/@regions.0/@vertices.3"/> | ||
90 | </vertices> | ||
91 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.5/@regions.0/@vertices.4/@outgoingTransitions.1 //@regions.0/@vertices.3/@regions.0/@vertices.1/@outgoingTransitions.1"> | ||
92 | <outgoingTransitions target="//@regions.1/@vertices.3"/> | ||
93 | <outgoingTransitions target="//@regions.0/@vertices.5/@regions.0/@vertices.4"/> | ||
94 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.6"/> | ||
95 | </vertices> | ||
96 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Exit" incomingTransitions="//@regions.0/@vertices.3/@regions.1/@vertices.1/@outgoingTransitions.2 //@regions.0/@vertices.5/@regions.0/@vertices.0/@outgoingTransitions.3"/> | ||
97 | </regions> | ||
98 | </vertices> | ||
99 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:FinalState" incomingTransitions="//@regions.1/@vertices.0/@outgoingTransitions.1 //@regions.0/@vertices.4/@outgoingTransitions.0 //@regions.1/@vertices.2/@outgoingTransitions.1"/> | ||
100 | </regions> | ||
101 | <regions> | ||
102 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Choice" incomingTransitions="//@regions.0/@vertices.3/@regions.0/@vertices.7/@outgoingTransitions.0 //@regions.0/@vertices.5/@regions.0/@vertices.3/@outgoingTransitions.0 //@regions.1/@vertices.0/@outgoingTransitions.2"> | ||
103 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.0/@vertices.7"/> | ||
104 | <outgoingTransitions target="//@regions.0/@vertices.6"/> | ||
105 | <outgoingTransitions target="//@regions.1/@vertices.0"/> | ||
106 | <outgoingTransitions target="//@regions.1/@vertices.5"/> | ||
107 | </vertices> | ||
108 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:FinalState" incomingTransitions="//@regions.1/@vertices.5/@outgoingTransitions.2 //@regions.0/@vertices.3/@outgoingTransitions.5"/> | ||
109 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.0/@vertices.5/@outgoingTransitions.0"> | ||
110 | <outgoingTransitions target="//@regions.0/@vertices.5"/> | ||
111 | <outgoingTransitions target="//@regions.0/@vertices.6"/> | ||
112 | </vertices> | ||
113 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Exit" incomingTransitions="//@regions.0/@vertices.5/@regions.0/@vertices.4/@outgoingTransitions.0 //@regions.0/@vertices.3/@regions.0/@vertices.5/@outgoingTransitions.3 //@regions.0/@vertices.3/@regions.0/@vertices.0/@outgoingTransitions.0"/> | ||
114 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:Entry"> | ||
115 | <outgoingTransitions target="//@regions.0/@vertices.5/@regions.0/@vertices.0"/> | ||
116 | </vertices> | ||
117 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.1/@vertices.0/@outgoingTransitions.3 //@regions.1/@vertices.5/@outgoingTransitions.1"> | ||
118 | <outgoingTransitions target="//@regions.0/@vertices.2"/> | ||
119 | <outgoingTransitions target="//@regions.1/@vertices.5"/> | ||
120 | <outgoingTransitions target="//@regions.1/@vertices.1"/> | ||
121 | <outgoingTransitions target="//@regions.1/@vertices.8"/> | ||
122 | </vertices> | ||
123 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:FinalState" incomingTransitions="//@regions.0/@vertices.3/@regions.1/@vertices.1/@outgoingTransitions.6"/> | ||
124 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:FinalState" incomingTransitions="//@regions.0/@vertices.3/@regions.1/@vertices.1/@outgoingTransitions.3"/> | ||
125 | <vertices xsi:type="hu.bme.mit.inf.yakindumm:State" incomingTransitions="//@regions.1/@vertices.5/@outgoingTransitions.3"> | ||
126 | <outgoingTransitions target="//@regions.0/@vertices.5/@regions.0/@vertices.1"/> | ||
127 | <outgoingTransitions target="//@regions.0/@vertices.3/@regions.1/@vertices.1"/> | ||
128 | </vertices> | ||
129 | </regions> | ||
130 | </hu.bme.mit.inf.yakindumm:Statechart> | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/info.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/info.csv new file mode 100644 index 00000000..e11b75f9 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/info.csv | |||
@@ -0,0 +1,2 @@ | |||
1 | ID,Time,# of Nodes,Out Degree,Node Activity,MPC,Violations | ||
2 | 1,3 : 50.959,100,0.031818181818181815,0.10775510204081633,0.10059701492537314,4 | ||