From 945f487a08b643392a5d5918c631640b9a0e4605 Mon Sep 17 00:00:00 2001 From: 20001LastOrder Date: Tue, 3 Nov 2020 22:52:26 -0500 Subject: add realistic solver --- Metrics/Metrics-Calculation/.project | 11 + .../SocialNetwork_plugin/.classpath | 11 + .../SocialNetwork_plugin/.project | 40 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../Metrics-Calculation/SocialNetwork_plugin/1.csv | 1 + .../SocialNetwork_plugin/META-INF/MANIFEST.MF | 35 + .../SocialNetwork_plugin/Measurement_Runner.launch | 17 + .../SocialNetworkGeneration.vsconfig | 24 + .../ca/mcgill/ecse/socialnetwork/plugin/.gitignore | 10 + .../mcgill/ecse/socialnetwork/plugin/Queries.vql | 54 + .../bin/constraints/ecore/.gitignore | 8 + .../SocialNetwork_plugin/bin/ecore.ecore | 1023 +++++++++++++ .../SocialNetwork_plugin/bin/ecore/.gitignore | 8 + .../SocialNetwork_plugin/bin/queries/.gitignore | 9 + .../SocialNetwork_plugin/bin/queries/Ecore.vql | 33 + .../SocialNetwork_plugin/bin/socialnetwork.aird | 183 +++ .../SocialNetwork_plugin/bin/socialnetwork.ecore | 17 + .../bin/socialnetwork.genmodel | 21 + .../bin/statistics/200_nodes.jpg | Bin 0 -> 49128 bytes .../bin/statistics/220_nodes.jpg | Bin 0 -> 51088 bytes .../bin/statistics/260_nodes.jpg | Bin 0 -> 51426 bytes .../bin/statistics/280_nodes.jpg | Bin 0 -> 50852 bytes .../SocialNetwork_plugin/bin/statistics/output.txt | 300 ++++ .../bin/statistics/plot_distribution.m | 11 + .../SocialNetwork_plugin/build.properties | 10 + .../data/Ecore/mpc_rep/Sql.ecore | 549 +++++++ .../data/Ecore/na_rep/XSHMLMT.ecore | 203 +++ .../data/Ecore/out_d_rep/rdm.ecore | 178 +++ .../SocialNetwork_plugin/data/Github/.DS_Store | Bin 0 -> 10244 bytes .../data/Github/mpc_rep/2samplemodel41.githubmodel | 105 ++ .../data/Github/na_rep/.DS_Store | Bin 0 -> 6148 bytes .../data/Github/na_rep/2samplemodel65.githubmodel | 38 + .../data/Github/out_d_rep/.DS_Store | Bin 0 -> 6148 bytes .../Github/out_d_rep/samplemodel62.githubmodel | 38 + .../data/Yakindumm/mpc_rep.csv | 9 + .../data/Yakindumm/mpc_rep/R_2016324.xmi | 128 ++ .../SocialNetwork_plugin/data/Yakindumm/na_rep.csv | 9 + .../data/Yakindumm/na_rep/R_2017419.xmi | 138 ++ .../data/Yakindumm/new/mpc_rep/R_2015194.xmi | 132 ++ .../data/Yakindumm/new/na_rep/R_2017131.xmi | 149 ++ .../data/Yakindumm/new/out_d_rep/R_2015248.xmi | 125 ++ .../data/Yakindumm/out_d_rep.csv | 9 + .../data/Yakindumm/out_d_rep/R_2015225.xmi | 145 ++ .../SocialNetwork_plugin/debug/errors.txt | 13 + .../SocialNetwork_plugin/ecore.vsconfig | 50 + .../encore_gen/socialnetwork/Person.java | 62 + .../encore_gen/socialnetwork/SocialNetwork.java | 62 + .../socialnetwork/SocialnetworkFactory.java | 51 + .../socialnetwork/SocialnetworkPackage.java | 293 ++++ .../encore_gen/socialnetwork/impl/PersonImpl.java | 208 +++ .../socialnetwork/impl/SocialNetworkImpl.java | 228 +++ .../impl/SocialnetworkFactoryImpl.java | 111 ++ .../impl/SocialnetworkPackageImpl.java | 267 ++++ .../util/SocialnetworkAdapterFactory.java | 138 ++ .../socialnetwork/util/SocialnetworkSwitch.java | 134 ++ .../SocialNetwork_plugin/generator.vqgen | 1 + .../SocialNetwork_plugin/github.vsconfig | 212 +++ .../SocialNetwork_plugin/inputs/ecore.xmi | 5 + .../SocialNetwork_plugin/inputs/github.xmi | 3 + .../SocialNetwork_plugin/inputs/start.xmi | 2 + .../SocialNetwork_plugin/model/ecore.ecore | 1023 +++++++++++++ .../SocialNetwork_plugin/model/socialnetwork.aird | 183 +++ .../SocialNetwork_plugin/model/socialnetwork.ecore | 17 + .../model/socialnetwork.genmodel | 21 + .../model/statistics/200_nodes.jpg | Bin 0 -> 49128 bytes .../model/statistics/220_nodes.jpg | Bin 0 -> 51088 bytes .../model/statistics/260_nodes.jpg | Bin 0 -> 51426 bytes .../model/statistics/280_nodes.jpg | Bin 0 -> 50852 bytes .../model/statistics/output.txt | 300 ++++ .../model/statistics/plot_distribution.m | 11 + .../SocialNetwork_plugin/output/.gitignore | 4 + .../SocialNetwork_plugin/plugin.properties | 4 + .../SocialNetwork_plugin/plugin.xml | 25 + .../SocialNetwork_plugin/queries/queries/Ecore.vql | 33 + .../ca/mcgill/ecse/socialnetwork/plugin/.gitignore | 10 + .../src-gen/constraints/ecore/.gitignore | 8 + .../SocialNetwork_plugin/src-gen/ecore/.gitignore | 8 + .../src-gen/queries/.gitignore | 9 + .../src-gen/queries/DirectSupertype.java | 703 +++++++++ .../src-gen/queries/Ecore.java | 108 ++ .../src-gen/queries/LoopInInheritence.java | 558 +++++++ .../src-gen/queries/NonSymmetricOpposite.java | 718 +++++++++ .../src-gen/queries/Opposite.java | 704 +++++++++ .../src-gen/queries/OppositeDifferentClass.java | 587 +++++++ .../src-gen/queries/SuperTypes.java | 703 +++++++++ .../mcgill/ecse/socialnetwork/plugin/Queries.vql | 54 + .../ca/mcgill/ecse/socialnetwork/runner/Main.java | 203 +++ .../ecse/socialnetwork/runner/Persisitence.java | 63 + .../ecse/socialnetwork/runner/RunnerTests.java | 18 + .../socialnetwork/runner/SocialNetworkModel.java | 62 + .../ecse/socialnetwork/runner/YakinduumModel.java | 52 + .../SocialNetwork_plugin/statistics/Ecore/100.csv | 22 + .../SocialNetwork_plugin/statistics/Ecore/30.csv | 22 + .../SocialNetwork_plugin/statistics/Ecore/50.csv | 22 + .../SocialNetwork_plugin/statistics/Ecore/80.csv | 22 + .../statistics/Ecore/warmup.csv | 3 + .../SocialNetwork_plugin/statistics/Github/30.csv | 22 + .../SocialNetwork_plugin/statistics/Github/50.csv | 22 + .../SocialNetwork_plugin/statistics/Github/80.csv | 22 + .../statistics/Github/warmup.csv | 7 + .../statistics/Yakindu/100.csv | 22 + .../statistics/Yakindu/120.csv | 22 + .../statistics/Yakindu/140.csv | 22 + .../SocialNetwork_plugin/statistics/Yakindu/30.csv | 22 + .../SocialNetwork_plugin/statistics/Yakindu/50.csv | 22 + .../SocialNetwork_plugin/statistics/Yakindu/80.csv | 22 + .../statistics/Yakindu/warmup.csv | 3 + .../SocialNetwork_plugin/statistics/file.csv | 4 + .../yakinduGeneration.vsconfig | 106 ++ .../SocialNetwork_plugin/yakinduum/.gitignore | 4 + .../.classpath | 12 + .../.gitignore | 6 + .../.project | 34 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../.settings/org.eclipse.wst.validation.prefs | 10 + .../Inputs/.gitignore | 4 + .../META-INF/MANIFEST.MF | 30 + .../build.properties | 4 + .../ecore/LoopInInheritenceConstraint0.java | 79 + .../ecore/NonSymmetricOppositeConstraint0.java | 80 + .../ecore/OppositeDifferentClassConstraint0.java | 79 + .../yakindumm/ChoiceHasNoIncomingConstraint0.java | 79 + .../yakindumm/ChoiceHasNoOutgoingConstraint0.java | 79 + .../yakindumm/IncomingToEntryConstraint0.java | 80 + .../MultipleEntryInRegionConstraint0.java | 79 + .../MultipleTransitionFromEntryConstraint0.java | 81 + .../yakindumm/NoEntryInRegionConstraint0.java | 79 + .../NoOutgoingTransitionFromEntryConstraint0.java | 79 + .../yakindumm/NoStateInRegionConstraint0.java | 79 + .../yakindumm/OutgoingFromExitConstraint0.java | 80 + .../yakindumm/OutgoingFromFinalConstraint0.java | 80 + .../constraints/ecore/.gitignore | 8 + .../constraints/ecore/DirectSupertype.java | 692 +++++++++ .../constraints/ecore/Ecore.java | 97 ++ .../constraints/ecore/LoopInInheritence.java | 548 +++++++ .../constraints/ecore/NonSymmetricOpposite.java | 707 +++++++++ .../constraints/ecore/Opposite.java | 693 +++++++++ .../constraints/ecore/OppositeDifferentClass.java | 577 +++++++ .../ecore.ecore | 1016 +++++++++++++ .../realistic/metrics/calculator/app/Domain.xtend | 7 + .../realistic/metrics/calculator/app/Main.xtend | 96 ++ .../app/PartialInterpretationMetric.xtend | 85 ++ .../app/PartialInterpretationMetricDistance.xtend | 216 +++ .../metrics/calculator/distance/CostDistance.xtend | 38 + .../calculator/distance/EuclideanDistance.xtend | 72 + .../metrics/calculator/distance/JSDistance.xtend | 88 ++ .../metrics/calculator/distance/KSDistance.xtend | 102 ++ .../metrics/calculator/graph/EMFGraph.xtend | 124 ++ .../realistic/metrics/calculator/graph/Graph.xtend | 71 + .../metrics/calculator/graph/GraphStatistic.xtend | 194 +++ .../graph/PartialInterpretationGraph.xtend | 134 ++ .../metrics/calculator/io/CsvFileWriter.xtend | 52 + .../metrics/calculator/io/GraphReader.xtend | 112 ++ .../metrics/calculator/io/RepMetricsReader.xtend | 100 ++ .../calculator/metrics/EdgeTypeMetric.xtend | 41 + .../metrics/calculator/metrics/Metric.xtend | 8 + .../calculator/metrics/MetricSampleGroup.xtend | 13 + .../MultiplexParticipationCoefficientMetric.xtend | 80 + .../calculator/metrics/NodeActivityMetric.xtend | 49 + .../calculator/metrics/NodeTypeMetric.xtend | 42 + .../calculator/metrics/OutDegreeMetric.xtend | 49 + .../metrics/TypedClusteringCoefficientMetric.xtend | 99 ++ .../calculator/metrics/TypedOutDegree.xtend | 60 + .../metrics/calculator/predictor/LinearModel.xtend | 91 ++ .../validation/ConstraintCollection.xtend | 80 + .../calculator/validation/ViolationCheck.xtend | 66 + .../Metrics-Calculation/metrics_plot/.gitignore | 10 + .../Measurements/Measurement1/input/.gitignore | 3 + .../Measurement1/output/distances/ecore/MPC.png | Bin 0 -> 76910 bytes .../output/distances/ecore/Node_Activity.png | Bin 0 -> 80932 bytes .../output/distances/ecore/Node_Type.png | Bin 0 -> 81909 bytes .../output/distances/ecore/Out_Degree.png | Bin 0 -> 80300 bytes .../output/distances/yakindumm/MPC.png | Bin 0 -> 85237 bytes .../output/distances/yakindumm/Node_Activity.png | Bin 0 -> 90510 bytes .../output/distances/yakindumm/Node_Type.png | Bin 0 -> 85365 bytes .../output/distances/yakindumm/Out_Degree.png | Bin 0 -> 88870 bytes .../Measurements/Measurement1/output/ecore/MPC.png | Bin 0 -> 93189 bytes .../Measurement1/output/ecore/Node_Activity.png | Bin 0 -> 51128 bytes .../Measurement1/output/ecore/Node_Type.png | Bin 0 -> 43395 bytes .../Measurement1/output/ecore/Out_Degree.png | Bin 0 -> 52053 bytes .../Measurement1/output/ecore/Violations.png | Bin 0 -> 79997 bytes .../Measurement1/output/github/MPC.png | Bin 0 -> 76528 bytes .../Measurement1/output/github/Node_Activity.png | Bin 0 -> 33237 bytes .../Measurement1/output/github/Node_Type.png | Bin 0 -> 30670 bytes .../Measurement1/output/github/Out_Degree.png | Bin 0 -> 28214 bytes .../Measurement1/output/github/Violations.png | Bin 0 -> 93823 bytes .../Measurement1/output/yakindumm/MPC.png | Bin 0 -> 81940 bytes .../output/yakindumm/Node_Activity.png | Bin 0 -> 41978 bytes .../Measurement1/output/yakindumm/Node_Type.png | Bin 0 -> 47047 bytes .../Measurement1/output/yakindumm/Out_Degree.png | Bin 0 -> 53711 bytes .../Measurement1/output/yakindumm/Violations.png | Bin 0 -> 111887 bytes .../Measurements/Measurement1/src/BoxPlot.ipynb | 362 +++++ .../Measurement1/src/DistancePlot.ipynb | 199 +++ .../metrics_plot/model comparison/input/.gitignore | 3 + .../MPC.png | Bin 0 -> 276146 bytes .../MPC_lengend.png | Bin 0 -> 292098 bytes .../Node Types.png | Bin 0 -> 264439 bytes .../Node Types_lengend.png | Bin 0 -> 292810 bytes .../Node_Activity.png | Bin 0 -> 257240 bytes .../Node_Activity_lengend.png | Bin 0 -> 297500 bytes .../Out_Degree.png | Bin 0 -> 254081 bytes .../Out_Degree_lengend.png | Bin 0 -> 292580 bytes .../MPC.png | Bin 0 -> 80427 bytes .../Node Activity.png | Bin 0 -> 49992 bytes .../Out Degree.png | Bin 0 -> 109041 bytes .../MPC.png | Bin 0 -> 241905 bytes .../MPC_lengend.png | Bin 0 -> 289113 bytes .../Node Types.png | Bin 0 -> 284666 bytes .../Node Types_lengend.png | Bin 0 -> 332518 bytes .../Node_Activity.png | Bin 0 -> 183889 bytes .../Node_Activity_lengend.png | Bin 0 -> 230868 bytes .../Node_Types.png | Bin 0 -> 238739 bytes .../Out_Degree.png | Bin 0 -> 197299 bytes .../Out_Degree_lengend.png | Bin 0 -> 244323 bytes .../Yakindumm/Human-Alloy-rep-/Node Types.png | Bin 0 -> 145568 bytes .../Human-Alloy-rep-/Node Types_lengend.png | Bin 0 -> 153817 bytes .../Yakindumm/Human-Alloy-rep-/Out_Degree.png | Bin 0 -> 132109 bytes .../Human-Alloy-rep-/Out_Degree_lengend.png | Bin 0 -> 147721 bytes .../MPC.png | Bin 0 -> 88476 bytes .../Node Activity.png | Bin 0 -> 73824 bytes .../Out Degree.png | Bin 0 -> 92754 bytes .../MPC.png | Bin 0 -> 116920 bytes .../Node Activity.png | Bin 0 -> 84045 bytes .../Out Degree.png | Bin 0 -> 121334 bytes .../MPC.png | Bin 0 -> 97444 bytes .../Node Activity.png | Bin 0 -> 87707 bytes .../Out Degree.png | Bin 0 -> 102356 bytes .../MPC.png | Bin 0 -> 54225 bytes .../Node Activity.png | Bin 0 -> 47898 bytes .../Out Degree.png | Bin 0 -> 88876 bytes .../MPC.png | Bin 0 -> 76828 bytes .../Node Activity.png | Bin 0 -> 77517 bytes .../Out Degree.png | Bin 0 -> 87612 bytes .../MPC.png | Bin 0 -> 77938 bytes .../Node Activity.png | Bin 0 -> 87383 bytes .../Out Degree.png | Bin 0 -> 99046 bytes .../MPC.png | Bin 0 -> 109723 bytes .../Node Activity.png | Bin 0 -> 80099 bytes .../Out Degree.png | Bin 0 -> 91912 bytes .../MPC.png | Bin 0 -> 112332 bytes .../Node Activity.png | Bin 0 -> 81639 bytes .../Out Degree.png | Bin 0 -> 92200 bytes .../MPC.png | Bin 0 -> 116546 bytes .../Node Activity.png | Bin 0 -> 93653 bytes .../Out Degree.png | Bin 0 -> 129648 bytes .../MPC.png | Bin 0 -> 118510 bytes .../Node Activity.png | Bin 0 -> 80223 bytes .../Out Degree.png | Bin 0 -> 120029 bytes .../MPC.png | Bin 0 -> 90540 bytes .../Node Activity.png | Bin 0 -> 75339 bytes .../Out Degree.png | Bin 0 -> 83932 bytes .../MPC.png | Bin 0 -> 93499 bytes .../Node Activity.png | Bin 0 -> 79559 bytes .../Out Degree.png | Bin 0 -> 95080 bytes .../MPC.png | Bin 0 -> 97946 bytes .../Node Activity.png | Bin 0 -> 80895 bytes .../Out Degree.png | Bin 0 -> 109969 bytes .../MPC.png | Bin 0 -> 82899 bytes .../Node Activity.png | Bin 0 -> 78754 bytes .../Out Degree.png | Bin 0 -> 110541 bytes .../MPC.png | Bin 0 -> 93318 bytes .../Node Activity.png | Bin 0 -> 72012 bytes .../Out Degree.png | Bin 0 -> 111830 bytes .../Human-Viatra (30 nodes)-/MPC.png | Bin 0 -> 113112 bytes .../Human-Viatra (30 nodes)-/Node Activity.png | Bin 0 -> 98628 bytes .../Human-Viatra (30 nodes)-/Out Degree.png | Bin 0 -> 110816 bytes .../Human-Viatra (30 nodes)-Random-/MPC.png | Bin 0 -> 136233 bytes .../Node Activity.png | Bin 0 -> 124315 bytes .../Human-Viatra (30 nodes)-Random-/Out Degree.png | Bin 0 -> 136745 bytes .../MPC.png | Bin 0 -> 116110 bytes .../Node Activity.png | Bin 0 -> 74006 bytes .../Out Degree.png | Bin 0 -> 117047 bytes .../JS_Distance/Human-Viatra (30 nodes)-/MPC.png | Bin 0 -> 135531 bytes .../Human-Viatra (30 nodes)-/Node Activity.png | Bin 0 -> 95290 bytes .../Human-Viatra (30 nodes)-/Out Degree.png | Bin 0 -> 134916 bytes .../Human-Viatra (30 nodes)-Random-/MPC.png | Bin 0 -> 184969 bytes .../Node Activity.png | Bin 0 -> 139857 bytes .../Human-Viatra (30 nodes)-Random-/Out Degree.png | Bin 0 -> 186513 bytes .../MPC.png | Bin 0 -> 95465 bytes .../Node Activity.png | Bin 0 -> 93444 bytes .../Out Degree.png | Bin 0 -> 97919 bytes .../KS_Distance/Human-Viatra (30 nodes)-/MPC.png | Bin 0 -> 92255 bytes .../Human-Viatra (30 nodes)-/Node Activity.png | Bin 0 -> 87694 bytes .../Human-Viatra (30 nodes)-/Out Degree.png | Bin 0 -> 86352 bytes .../MPC.png | Bin 0 -> 98310 bytes .../Node Activity.png | Bin 0 -> 85826 bytes .../Out Degree.png | Bin 0 -> 86139 bytes .../Human-Viatra (30 nodes)-Random-/MPC.png | Bin 0 -> 127107 bytes .../Node Activity.png | Bin 0 -> 118735 bytes .../Human-Viatra (30 nodes)-Random-/Out Degree.png | Bin 0 -> 116864 bytes .../MPC.png | Bin 0 -> 85397 bytes .../Node Activity.png | Bin 0 -> 87774 bytes .../Out Degree.png | Bin 0 -> 95122 bytes .../MPC.png | Bin 0 -> 171018 bytes .../Node Activity.png | Bin 0 -> 114184 bytes .../Out Degree.png | Bin 0 -> 139638 bytes .../Human-Viatra consistent (100 nodes)-/MPC.png | Bin 0 -> 69041 bytes .../Node Activity.png | Bin 0 -> 50629 bytes .../Out Degree.png | Bin 0 -> 60762 bytes .../KS_Distance/real vs viatra vs alloy/MPC.png | Bin 0 -> 97403 bytes .../real vs viatra vs alloy/Node Activity.png | Bin 0 -> 88084 bytes .../real vs viatra vs alloy/Out Degree.png | Bin 0 -> 87391 bytes .../output/ecore/Hum-All-Rand-GS-Real-Med-/MPC.png | Bin 0 -> 260244 bytes .../Hum-All-Rand-GS-Real-Med-/MPC_lengend.png | Bin 0 -> 284435 bytes .../Hum-All-Rand-GS-Real-Med-/Node_Activity.png | Bin 0 -> 240919 bytes .../Node_Activity_lengend.png | Bin 0 -> 267128 bytes .../ecore/Hum-All-Rand-GS-Real-Med-/Node_Types.png | Bin 0 -> 259504 bytes .../Node_Types_lengend.png | Bin 0 -> 283224 bytes .../ecore/Hum-All-Rand-GS-Real-Med-/Out_Degree.png | Bin 0 -> 249861 bytes .../Out_Degree_lengend.png | Bin 0 -> 276261 bytes .../github/Hum-All-Rand-GS-Real-Med-/MPC.png | Bin 0 -> 250477 bytes .../Hum-All-Rand-GS-Real-Med-/MPC_lengend.png | Bin 0 -> 275605 bytes .../Hum-All-Rand-GS-Real-Med-/Node_Activity.png | Bin 0 -> 213651 bytes .../Node_Activity_lengend.png | Bin 0 -> 220028 bytes .../Hum-All-Rand-GS-Real-Med-/Node_Types.png | Bin 0 -> 259490 bytes .../Node_Types_lengend.png | Bin 0 -> 279286 bytes .../Hum-All-Rand-GS-Real-Med-/Out_Degree.png | Bin 0 -> 245269 bytes .../Out_Degree_lengend.png | Bin 0 -> 264147 bytes .../model comparison/output/test/Hum-/TCC.png | Bin 0 -> 212431 bytes .../output/test/Hum-/TCC_lengend.png | Bin 0 -> 218167 bytes .../output/test/Hum-Rand-GS-Real-/TCC.png | Bin 0 -> 167662 bytes .../output/test/Hum-Rand-GS-Real-/TCC_lengend.png | Bin 0 -> 187842 bytes .../model comparison/output/test/Hum-Real-/TCC.png | Bin 0 -> 132637 bytes .../output/test/Hum-Real-/TCC_lengend.png | Bin 0 -> 141912 bytes .../yakindu/Hum-All-Rand-GS-Real-Med-/MPC.png | Bin 0 -> 255461 bytes .../Hum-All-Rand-GS-Real-Med-/MPC_lengend.png | Bin 0 -> 269454 bytes .../Hum-All-Rand-GS-Real-Med-/Node_Activity.png | Bin 0 -> 206259 bytes .../Node_Activity_lengend.png | Bin 0 -> 235800 bytes .../Hum-All-Rand-GS-Real-Med-/Node_Types.png | Bin 0 -> 225675 bytes .../Node_Types_lengend.png | Bin 0 -> 230053 bytes .../Hum-All-Rand-GS-Real-Med-/Out_Degree.png | Bin 0 -> 198476 bytes .../Out_Degree_lengend.png | Bin 0 -> 226169 bytes .../model comparison/src/plot_ks_stats.py | 158 ++ .../model_evolve_comparison/input/.gitignore | 3 + .../output/controled_viatra_all/Node Activity.jpg | Bin 0 -> 456785 bytes .../output/controled_viatra_all/mpc.jpg | Bin 0 -> 417210 bytes .../output/controled_viatra_all/out_degree.jpg | Bin 0 -> 334113 bytes .../controled_viatra_with_mpc/Node Activity.jpg | Bin 0 -> 485539 bytes .../output/controled_viatra_with_mpc/mpc.jpg | Bin 0 -> 458414 bytes .../controled_viatra_with_mpc/out_degree.jpg | Bin 0 -> 399413 bytes .../Node Activity.jpg | Bin 0 -> 450131 bytes .../controled_viatra_with_node_activity/mpc.jpg | Bin 0 -> 492440 bytes .../out_degree.jpg | Bin 0 -> 427143 bytes .../Node Activity.jpg | Bin 0 -> 387627 bytes .../controled_viatra_with_out_degree/mpc.jpg | Bin 0 -> 439155 bytes .../out_degree.jpg | Bin 0 -> 368624 bytes .../output/random_emf/mpc.jpg | Bin 0 -> 363202 bytes .../output/random_emf/node activity.jpg | Bin 0 -> 367839 bytes .../output/random_emf/out degree.jpg | Bin 0 -> 284983 bytes .../random_emf_instantiator/Node Activity.jpg | Bin 0 -> 208107 bytes .../output/random_emf_instantiator/mpc.jpg | Bin 0 -> 157479 bytes .../output/random_emf_instantiator/out_degree.jpg | Bin 0 -> 199042 bytes .../output/random_emf_normal/mpc.jpg | Bin 0 -> 332516 bytes .../output/random_emf_normal/node activity.jpg | Bin 0 -> 316516 bytes .../output/random_emf_normal/out degree.jpg | Bin 0 -> 266138 bytes .../output/viatra_constraints/MPC.jpg | Bin 0 -> 509668 bytes .../output/viatra_constraints/node activity.jpg | Bin 0 -> 507236 bytes .../output/viatra_constraints/out degree.jpg | Bin 0 -> 500415 bytes .../Node Activity.jpg | Bin 0 -> 432110 bytes .../viatra_control_all_with_consistency/mpc.jpg | Bin 0 -> 390522 bytes .../out_degree.jpg | Bin 0 -> 332996 bytes .../output/viatra_no_constraints/MPC.jpg | Bin 0 -> 581421 bytes .../output/viatra_no_constraints/node activity.jpg | Bin 0 -> 558356 bytes .../output/viatra_no_constraints/out degree.jpg | Bin 0 -> 534429 bytes .../src/metrics_distance.ipynb | 481 ++++++ .../src/metrics_distance_with_selector.ipynb | 1600 ++++++++++++++++++++ .../src/representative_selector .ipynb | 392 +++++ .../metrics_plot/type_analysis/input/.gitignore | 3 + .../type_analysis/src/Node Type Analysis.ipynb | 435 ++++++ .../type_analysis/src/plot_violation.py | 77 + .../metrics_plot/utils/DistributionMetrics.py | 53 + .../metrics_plot/utils/GraphType.py | 46 + .../metrics_plot/utils/constants.py | 35 + .../metrics_plot/utils/readCSV.py | 186 +++ 374 files changed, 23923 insertions(+) create mode 100644 Metrics/Metrics-Calculation/.project create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/.classpath create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/.project create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/.settings/org.eclipse.jdt.core.prefs create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/1.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/META-INF/MANIFEST.MF create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/Measurement_Runner.launch create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/SocialNetworkGeneration.vsconfig create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ca/mcgill/ecse/socialnetwork/plugin/.gitignore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/constraints/ecore/.gitignore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ecore.ecore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ecore/.gitignore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/queries/.gitignore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/queries/Ecore.vql create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.aird create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.ecore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.genmodel create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/200_nodes.jpg create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/220_nodes.jpg create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/260_nodes.jpg create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/280_nodes.jpg create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/output.txt create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/plot_distribution.m create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/build.properties create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/mpc_rep/Sql.ecore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/na_rep/XSHMLMT.ecore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/out_d_rep/rdm.ecore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/.DS_Store create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/mpc_rep/2samplemodel41.githubmodel create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/na_rep/.DS_Store create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/na_rep/2samplemodel65.githubmodel create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/out_d_rep/.DS_Store create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/out_d_rep/samplemodel62.githubmodel create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/mpc_rep.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/mpc_rep/R_2016324.xmi create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/na_rep.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/na_rep/R_2017419.xmi create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/mpc_rep/R_2015194.xmi create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/na_rep/R_2017131.xmi create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/out_d_rep/R_2015248.xmi create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/out_d_rep.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/out_d_rep/R_2015225.xmi create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/debug/errors.txt create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/ecore.vsconfig create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/Person.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialNetwork.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkFactory.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/SocialnetworkPackage.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkAdapterFactory.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/util/SocialnetworkSwitch.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/generator.vqgen create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/github.vsconfig create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/ecore.xmi create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/github.xmi create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/start.xmi create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/ecore.ecore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.aird create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.ecore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/socialnetwork.genmodel create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/200_nodes.jpg create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/220_nodes.jpg create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/260_nodes.jpg create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/280_nodes.jpg create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/output.txt create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/plot_distribution.m create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/output/.gitignore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/plugin.properties create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/plugin.xml create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/queries/queries/Ecore.vql create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/ca/mcgill/ecse/socialnetwork/plugin/.gitignore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/constraints/ecore/.gitignore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/ecore/.gitignore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/.gitignore create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/DirectSupertype.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/Ecore.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/LoopInInheritence.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/NonSymmetricOpposite.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/Opposite.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/OppositeDifferentClass.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/SuperTypes.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/Main.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/Persisitence.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/RunnerTests.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/SocialNetworkModel.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/YakinduumModel.java create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/100.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/30.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/50.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/80.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/warmup.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/30.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/50.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/80.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/warmup.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/100.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/120.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/140.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/30.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/50.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/80.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/warmup.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/file.csv create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduGeneration.vsconfig create mode 100644 Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/.gitignore create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.classpath create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.gitignore create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.project create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.settings/org.eclipse.jdt.core.prefs create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.settings/org.eclipse.wst.validation.prefs create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/Inputs/.gitignore create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/META-INF/MANIFEST.MF create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/build.properties create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/LoopInInheritenceConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/NonSymmetricOppositeConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/OppositeDifferentClassConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/ChoiceHasNoIncomingConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/ChoiceHasNoOutgoingConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/IncomingToEntryConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/MultipleEntryInRegionConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/MultipleTransitionFromEntryConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoEntryInRegionConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoOutgoingTransitionFromEntryConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoStateInRegionConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/OutgoingFromExitConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/OutgoingFromFinalConstraint0.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/.gitignore create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/DirectSupertype.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/Ecore.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/LoopInInheritence.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/NonSymmetricOpposite.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/Opposite.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/OppositeDifferentClass.java create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/ecore.ecore create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/Domain.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/Main.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetric.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetricDistance.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/CostDistance.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/EuclideanDistance.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/JSDistance.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/KSDistance.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/EMFGraph.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/Graph.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/GraphStatistic.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/CsvFileWriter.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/RepMetricsReader.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/EdgeTypeMetric.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/Metric.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/MetricSampleGroup.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/MultiplexParticipationCoefficientMetric.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/NodeActivityMetric.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/NodeTypeMetric.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/OutDegreeMetric.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/TypedClusteringCoefficientMetric.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/TypedOutDegree.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/predictor/LinearModel.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/validation/ConstraintCollection.xtend create mode 100644 Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/validation/ViolationCheck.xtend create mode 100644 Metrics/Metrics-Calculation/metrics_plot/.gitignore create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/input/.gitignore create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Node_Type.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Node_Type.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Node_Type.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Violations.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Node_Type.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Violations.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Node_Type.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Violations.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/src/BoxPlot.ipynb create mode 100644 Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/src/DistancePlot.ipynb create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/input/.gitignore create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node Types.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Types.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Node Types.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Node Types_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Out_Degree_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/Node Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/Out Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Types.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Types.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-/TCC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-/TCC_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Rand-GS-Real-/TCC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Rand-GS-Real-/TCC_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Real-/TCC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Real-/TCC_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/MPC.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Activity.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Types.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Out_Degree.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model comparison/src/plot_ks_stats.py create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/input/.gitignore create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/Node Activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/mpc.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/out_degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/Node Activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/mpc.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/out_degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/Node Activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/mpc.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/out_degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/Node Activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/mpc.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/out_degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/mpc.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/node activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/out degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/Node Activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/mpc.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/out_degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/mpc.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/node activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/out degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/MPC.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/node activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/out degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/Node Activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/mpc.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/out_degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/MPC.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/node activity.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/out degree.jpg create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/metrics_distance.ipynb create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/metrics_distance_with_selector.ipynb create mode 100644 Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/representative_selector .ipynb create mode 100644 Metrics/Metrics-Calculation/metrics_plot/type_analysis/input/.gitignore create mode 100644 Metrics/Metrics-Calculation/metrics_plot/type_analysis/src/Node Type Analysis.ipynb create mode 100644 Metrics/Metrics-Calculation/metrics_plot/type_analysis/src/plot_violation.py create mode 100644 Metrics/Metrics-Calculation/metrics_plot/utils/DistributionMetrics.py create mode 100644 Metrics/Metrics-Calculation/metrics_plot/utils/GraphType.py create mode 100644 Metrics/Metrics-Calculation/metrics_plot/utils/constants.py create mode 100644 Metrics/Metrics-Calculation/metrics_plot/utils/readCSV.py (limited to 'Metrics') diff --git a/Metrics/Metrics-Calculation/.project b/Metrics/Metrics-Calculation/.project new file mode 100644 index 00000000..8cdd9483 --- /dev/null +++ b/Metrics/Metrics-Calculation/.project @@ -0,0 +1,11 @@ + + + Metrics-Calculation + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/.classpath b/Metrics/Metrics-Calculation/SocialNetwork_plugin/.classpath new file mode 100644 index 00000000..4f2afbc9 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + 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 @@ + + + SocialNetwork_plugin + + + + + + org.eclipse.viatra.query.tooling.ui.projectbuilder + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.viatra.query.projectnature + org.eclipse.xtext.ui.shared.xtextNature + + 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 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +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..833b6fd8 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/META-INF/MANIFEST.MF @@ -0,0 +1,35 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: SocialNetwork_plugin;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Export-Package: ca.mcgill.ecse.socialnetwork.plugin, + ca.mcgill.ecse.socialnetwork.runner, + constraints.ecore, + ecore, + queries, + socialnetwork, + socialnetwork.impl, + socialnetwork.util +Require-Bundle: org.eclipse.viatra.query.runtime.rete, + org.eclipse.viatra.query.runtime.localsearch, + org.eclipse.xtext.xbase.lib, + org.eclipse.viatra.query.runtime, + org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport, + org.eclipse.emf.ecore.xmi;bundle-version="2.15.0", + hu.bme.mit.inf.dslreasoner.application;bundle-version="1.0.0", + org.junit;bundle-version="4.12.0", + org.eclipse.collections;bundle-version="9.2.0", + hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph;bundle-version="1.0.0", + ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator;bundle-version="1.0.0", + hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.validation;bundle-version="0.0.1" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy +Main-Class: ca.mcgill.ecse.socialnetwork.runner.Main +Automatic-Module-Name: SocialNetwork_plugin +Import-Package: org.apache.log4j, + org.junit;version="4.12.0" diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/Measurement_Runner.launch b/Metrics/Metrics-Calculation/SocialNetwork_plugin/Measurement_Runner.launch new file mode 100644 index 00000000..c69ce6f0 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/Measurement_Runner.launch @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + 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 @@ +import epackage "model/socialnetwork.ecore" +import viatra "src/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql" + +generate { + metamodel = { package socialnetwork } + //constraints = { package ca.mcgill.ecse.socialnetwork.plugin } + partial-model = { "inputs/280nodes.xmi"} + + solver = ViatraSolver + + scope = { + #node = 301 + } + + number = 1 + runs = 1 + config = { + log-level = normal + } + + debug = "output/debug" + output = "output" + log = "output/log.txt" +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ca/mcgill/ecse/socialnetwork/plugin/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ca/mcgill/ecse/socialnetwork/plugin/.gitignore new file mode 100644 index 00000000..f2558cf5 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ca/mcgill/ecse/socialnetwork/plugin/.gitignore @@ -0,0 +1,10 @@ +/.Friendship.java._trace +/.NoFriend.java._trace +/.Queries.java._trace +/.SelfFriend.java._trace +/.SingleFriendship.java._trace +/Friendship.java +/NoFriend.java +/Queries.java +/SelfFriend.java +/SingleFriendship.java diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql new file mode 100644 index 00000000..3e7fc68c --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ca/mcgill/ecse/socialnetwork/plugin/Queries.vql @@ -0,0 +1,54 @@ +package ca.mcgill.ecse.socialnetwork.plugin + +import epackage "http://ecse.mcgill.ca/socialnetwork" + +//@Constraint(message="terminatorAndInformation", severity="error", key={T}) +//pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { +// FunctionalOutput.outgoingLinks(Out,I); +// FunctionalOutput.terminator(Out,T); +//} or { +// InformationLink.to(I,In); +// FunctionalInput.terminator(In,T); +//} + +@Constraint(message="singleFriendship", severity="error", key={p1}) +pattern singleFriendship(p1: Person) { + find friendship(p1, p); + neg find friendship(p, p1); +} + +//@Constraint(message="cycle", severity="error", key={p}) +//pattern cycleInParenthood(p: Person) { +// find isAncestor(p, p); +//} + +@Constraint(message="noFriend", severity="error", key={p}) +pattern noFriend(p: Person){ + neg find friendship(p, _); +} + +//@Constraint(message="brothhoodParent", severity="error", key={p1,p2}) +//pattern brothhoodParent(p1: Person, p2: Person){ +// Person.parents(p1, parent1); +// Person.parents(p2, parent2); +// parent1 == parent2; +// find isAncestor(p1, p2); +//} +@Constraint(message="selfFriend", severity="error", key={p}) +pattern selfFriend(p: Person){ + Person.friends(p,p); +} + +pattern friendship(p1: Person, p2: Person){ + Person.friends(p1,p2); +} + +//pattern isAncestor(person : Person, ancestor : Person){ +// Person.parents(person, ancestor); +//} or { +// Person.parents(person, parent); +// find isAncestor(parent, ancestor); +//} + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/constraints/ecore/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/constraints/ecore/.gitignore new file mode 100644 index 00000000..c42ca056 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/constraints/ecore/.gitignore @@ -0,0 +1,8 @@ +/.Ecore_pattern.java._trace +/.MoreThenFiveSuperTypes.java._trace +/.DirectSupertype.java._trace +/.Ecore.java._trace +/.LoopInInheritence.java._trace +/.NonSymmetricOpposite.java._trace +/.Opposite.java._trace +/.OppositeDifferentClass.java._trace diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ecore.ecore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ecore.ecore new file mode 100644 index 00000000..eaaf3d11 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ecore.ecore @@ -0,0 +1,1023 @@ + + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + +
+
+ + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + + +
+
+ + +
+ + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + + + + + +
+
+ + + +
+
+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + + +
+
+ + +
+ + + + + + + + + + + + +
+
+ + + + + +
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + + + + + + + + + + + + + +
+
+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + +
+
+ + + + +
+ + + + +
+ + + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + + + +
+
+ + + + + + +
+
+ + + + + +
+
+ + +
+ + + +
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + + + + + +
+
+ + +
+ + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + +
+ + + + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+ + + + + +
+
+ + +
+ + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ecore/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ecore/.gitignore new file mode 100644 index 00000000..c42ca056 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/ecore/.gitignore @@ -0,0 +1,8 @@ +/.Ecore_pattern.java._trace +/.MoreThenFiveSuperTypes.java._trace +/.DirectSupertype.java._trace +/.Ecore.java._trace +/.LoopInInheritence.java._trace +/.NonSymmetricOpposite.java._trace +/.Opposite.java._trace +/.OppositeDifferentClass.java._trace diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/queries/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/queries/.gitignore new file mode 100644 index 00000000..e9d711d4 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/queries/.gitignore @@ -0,0 +1,9 @@ +/.Ecore_pattern.java._trace +/.MoreThenFiveSuperTypes.java._trace +/.DirectSupertype.java._trace +/.Ecore.java._trace +/.LoopInInheritence.java._trace +/.NonSymmetricOpposite.java._trace +/.Opposite.java._trace +/.OppositeDifferentClass.java._trace +/.SuperTypes.java._trace diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/queries/Ecore.vql b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/queries/Ecore.vql new file mode 100644 index 00000000..9ddb64c9 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/queries/Ecore.vql @@ -0,0 +1,33 @@ +package queries + +import epackage "http://www.eclipse.org/emf/2002/Ecore" + +pattern directSupertype(a: EClass, b:EClass) { + EClass.eSuperTypes(a,b); +} + +@Constraint(key={a}, severity="error", message="error") +pattern loopInInheritence(a: EClass) { + find directSupertype+(a,a); +} + +pattern opposite(a:EReference, b: EReference) { + EReference.eOpposite(a,b); +} +@Constraint(key={a}, severity="error", message="error") +pattern oppositeDifferentClass(a:EReference) { + EReference.eOpposite(a,b); + EReference.eContainingClass(a,aContaining); + EReference.eType(b,bTarget); + aContaining != bTarget; +} + +@Constraint(key={a}, severity="error", message="error") +pattern nonSymmetricOpposite(a:EReference, b:EReference) { + find opposite(a,b); + neg find opposite(b,a); +} + +pattern superTypes(c1:EClass, c2:EClass){ + EClass.eSuperTypes(c1,c2); +} diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.aird b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.aird new file mode 100644 index 00000000..e7e28ecd --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.aird @@ -0,0 +1,183 @@ + + + + socialnetwork.ecore + socialnetwork.genmodel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.ecore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.ecore new file mode 100644 index 00000000..cacf9921 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.ecore @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.genmodel b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.genmodel new file mode 100644 index 00000000..c9515653 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/socialnetwork.genmodel @@ -0,0 +1,21 @@ + + + socialnetwork.ecore + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/200_nodes.jpg b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/200_nodes.jpg new file mode 100644 index 00000000..a35c291b Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/200_nodes.jpg differ diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/220_nodes.jpg b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/220_nodes.jpg new file mode 100644 index 00000000..4d41dff7 Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/220_nodes.jpg differ diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/260_nodes.jpg b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/260_nodes.jpg new file mode 100644 index 00000000..b16cdfb2 Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/260_nodes.jpg differ diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/280_nodes.jpg b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/280_nodes.jpg new file mode 100644 index 00000000..16c0ee23 Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/280_nodes.jpg differ diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/output.txt b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/output.txt new file mode 100644 index 00000000..35158e20 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/output.txt @@ -0,0 +1,300 @@ +1 +9 +7 +0 +4 +6 +16 +0 +2 +4 +17 +20 +1 +5 +2 +3 +11 +6 +4 +0 +2 +1 +3 +5 +9 +13 +11 +0 +1 +10 +3 +0 +1 +1 +0 +17 +0 +4 +2 +0 +1 +10 +10 +0 +24 +9 +0 +14 +1 +11 +2 +17 +3 +3 +3 +0 +3 +1 +3 +2 +2 +1 +0 +3 +6 +3 +16 +3 +10 +6 +6 +6 +11 +6 +10 +20 +1 +4 +13 +0 +0 +3 +2 +0 +12 +0 +0 +22 +4 +0 +0 +20 +1 +10 +9 +11 +5 +27 +1 +3 +9 +0 +23 +10 +9 +23 +0 +3 +7 +2 +0 +9 +3 +0 +12 +11 +7 +6 +9 +2 +0 +3 +4 +3 +9 +3 +0 +7 +2 +1 +9 +1 +11 +6 +5 +16 +0 +19 +14 +9 +13 +2 +8 +0 +6 +1 +1 +2 +0 +3 +15 +3 +0 +3 +17 +1 +15 +5 +1 +21 +8 +2 +7 +3 +16 +11 +1 +5 +1 +5 +1 +6 +3 +16 +6 +17 +3 +5 +7 +2 +9 +2 +1 +11 +1 +0 +3 +5 +6 +2 +5 +1 +4 +9 +0 +11 +1 +10 +13 +6 +2 +1 +3 +4 +0 +1 +2 +10 +12 +3 +3 +3 +0 +2 +4 +2 +18 +3 +8 +7 +5 +3 +16 +1 +4 +8 +15 +1 +11 +15 +1 +8 +7 +1 +2 +0 +9 +5 +2 +1 +3 +6 +4 +8 +3 +12 +4 +21 +9 +2 +3 +2 +1 +3 +11 +2 +9 +0 +10 +6 +1 +2 +0 +8 +5 +2 +3 +8 +1 +13 +8 +2 +2 +11 +4 +21 +6 +5 +0 +8 +8 +12 +0 +0 +4 +1 +19 +5 +3 +1 +3 +12 +2 +6 +11 +8 +8 +2 +18 +0 diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/plot_distribution.m b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/plot_distribution.m new file mode 100644 index 00000000..4c67a191 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/bin/statistics/plot_distribution.m @@ -0,0 +1,11 @@ +clear; +clc; + +matrix = load('-ascii', "output.txt"); +hist(matrix,unique(matrix)); +hold on; +[a,b] = hist(matrix,unique(matrix)) +plot(b, a) +hold off; +sum(matrix) +average = sum(matrix) / length(matrix) \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/build.properties b/Metrics/Metrics-Calculation/SocialNetwork_plugin/build.properties new file mode 100644 index 00000000..b91f214f --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/build.properties @@ -0,0 +1,10 @@ +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + src/ +jars.compile.order = . +source.. = encore_gen/,\ + src-gen/ +output.. = bin/ diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/mpc_rep/Sql.ecore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/mpc_rep/Sql.ecore new file mode 100644 index 00000000..65d72135 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/mpc_rep/Sql.ecore @@ -0,0 +1,549 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/na_rep/XSHMLMT.ecore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/na_rep/XSHMLMT.ecore new file mode 100644 index 00000000..f741662e --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/na_rep/XSHMLMT.ecore @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/out_d_rep/rdm.ecore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/out_d_rep/rdm.ecore new file mode 100644 index 00000000..5c01ab01 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Ecore/out_d_rep/rdm.ecore @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/.DS_Store b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/.DS_Store new file mode 100644 index 00000000..85929cb0 Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/.DS_Store differ diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/mpc_rep/2samplemodel41.githubmodel b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/mpc_rep/2samplemodel41.githubmodel new file mode 100644 index 00000000..f4a3233c --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/mpc_rep/2samplemodel41.githubmodel @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/na_rep/.DS_Store b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/na_rep/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/na_rep/.DS_Store differ diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/na_rep/2samplemodel65.githubmodel b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/na_rep/2samplemodel65.githubmodel new file mode 100644 index 00000000..c78f0175 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/na_rep/2samplemodel65.githubmodel @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/out_d_rep/.DS_Store b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/out_d_rep/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/out_d_rep/.DS_Store differ diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/out_d_rep/samplemodel62.githubmodel b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/out_d_rep/samplemodel62.githubmodel new file mode 100644 index 00000000..c78f0175 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Github/out_d_rep/samplemodel62.githubmodel @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/mpc_rep.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/mpc_rep.csv new file mode 100644 index 00000000..fc39ac54 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/mpc_rep.csv @@ -0,0 +1,9 @@ +Meta Mode,yakindumm +Number of Edge types,6 +Number Of Nodes,67 +OutDegreeValue,1,2,3,4,6,8,9 +OutDegreeCount,4,45,9,1,1,2,5 +NAValue,1,2,3,4,5,6 +NACount,1,3,4,42,15,2 +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 +MPCCount,1,2,1,1,3,1,42,2,2,7,1,2,1,1 diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/mpc_rep/R_2016324.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/mpc_rep/R_2016324.xmi new file mode 100644 index 00000000..493a1731 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/mpc_rep/R_2016324.xmi @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/na_rep.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/na_rep.csv new file mode 100644 index 00000000..43d411e4 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/na_rep.csv @@ -0,0 +1,9 @@ +Meta Mode,yakindumm +Number of Edge types,6 +Number Of Nodes,98 +OutDegreeValue,1,2,3,4,5,6,10,15 +OutDegreeCount,7,61,17,2,3,2,5,1 +NAValue,1,2,3,4,5,6 +NACount,1,4,6,62,23,2 +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 +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/Yakindumm/na_rep/R_2017419.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/na_rep/R_2017419.xmi new file mode 100644 index 00000000..369760bf --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/na_rep/R_2017419.xmi @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/mpc_rep/R_2015194.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/mpc_rep/R_2015194.xmi new file mode 100644 index 00000000..25ff5ce0 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/mpc_rep/R_2015194.xmi @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/na_rep/R_2017131.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/na_rep/R_2017131.xmi new file mode 100644 index 00000000..39780f72 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/na_rep/R_2017131.xmi @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/out_d_rep/R_2015248.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/out_d_rep/R_2015248.xmi new file mode 100644 index 00000000..e7fe8114 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/new/out_d_rep/R_2015248.xmi @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/out_d_rep.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/out_d_rep.csv new file mode 100644 index 00000000..17965018 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/out_d_rep.csv @@ -0,0 +1,9 @@ +Meta Mode,yakindumm +Number of Edge types,6 +Number Of Nodes,88 +OutDegreeValue,1,2,3,4,5,6,8,10,11,13 +OutDegreeCount,6,57,12,3,1,2,2,3,1,1 +NAValue,1,2,3,4,5,6 +NACount,1,3,6,56,20,2 +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 +MPCCount,1,1,1,1,1,5,2,56,1,2,3,10,1,1,2 diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/out_d_rep/R_2015225.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/out_d_rep/R_2015225.xmi new file mode 100644 index 00000000..21fee5a9 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/data/Yakindumm/out_d_rep/R_2015225.xmi @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/debug/errors.txt b/Metrics/Metrics-Calculation/SocialNetwork_plugin/debug/errors.txt new file mode 100644 index 00000000..0de2ebdb --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/debug/errors.txt @@ -0,0 +1,13 @@ +Error occured (NullPointerException): + hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner.lambda$11(ViatraReasoner.java:263) + org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow(ObjectExtensions.java:140) + hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner.lambda$1(ViatraReasoner.java:267) + org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow(ObjectExtensions.java:140) + hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner.solve(ViatraReasoner.java:347) + hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor.executeGenerationTask(GenerationTaskExecutor.java:319) + hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor._execute(ScriptExecutor.java:134) + hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:363) + hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:115) + hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor.executeScript(StandaloneScriptExecutor.java:149) + ca.mcgill.ecse.socialnetwork.runner.Main.runWithPath(Main.java:24) + ca.mcgill.ecse.socialnetwork.runner.Main.main(Main.java:40) diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/ecore.vsconfig b/Metrics/Metrics-Calculation/SocialNetwork_plugin/ecore.vsconfig new file mode 100644 index 00000000..85202b9d --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/ecore.vsconfig @@ -0,0 +1,50 @@ +import viatra "./queries/queries/Ecore.vql" +import epackage "http://www.eclipse.org/emf/2002/Ecore" + +// Copy this for different model sizes +generate { + metamodel = {package ecore excluding{EClassifier.instanceClass, EClassifier.defaultValue, + EEnumLiteral.instance, EStructuralFeature.defaultValue, EStructuralFeature.changeable, + EStructuralFeature.derived, ENamedElement.name, EClass.interface, EClass.abstract, EClassifier.instanceTypeName, + EClassifier.instanceClassName, EPackage.nsPrefix, EPackage.nsURI, EAnnotation.source, + EAttribute.iD, EDataType.serializable, EEnumLiteral.literal, EEnumLiteral.value, + EReference.resolveProxies, EReference.container, EReference.containment, EStringToStringMapEntry.key, + EStringToStringMapEntry.value, EStructuralFeature.defaultValueLiteral, EStructuralFeature.transient, + EStructuralFeature.unsettable, EStructuralFeature.volatile, ETypedElement.lowerBound, + ETypedElement.many, ETypedElement.ordered, ETypedElement.required, ETypedElement.unique,ETypedElement.upperBound, + // cannot generate eFactoryInstance + EPackage.eFactoryInstance, + //Derived edges + EClass.eAllSuperTypes, EClass.eAllAttributes, EClass.eAllReferences, EClass.eAllContainments, EClass.eAllGenericSuperTypes, + EClass. eAllOperations, EClass.eAllStructuralFeatures, EClass.eAttributes, EClass.eIDAttribute, EClass.eReferences, + EAttribute.eAttributeType, EGenericType.eRawType, EReference.eReferenceType, + //Generic Types + EClass.eGenericSuperTypes, ETypedElement.eGenericType, EOperation.eGenericExceptions, EObject, EAnnotation.references, EAnnotation.contents + + }} + partial-model = { "inputs/ecore.xmi"} + constraints = { package queries } + + + solver = ViatraSolver + + //median run time + scope = { + #node = 30 // (warm-up: 10) 30, 50, 80, 100, 120 .... + } + + number = 1 + runs = 1 + config = { + log-level = none, + runtime = 300, // the runtime is in seconds, want to set is to 5 mins + "optional-wf" = "false", + "realistic-guidance" = "Composite", + "allow-must-violations" = "false", + "domain" = "Ecore" + } + + debug = "debug" + statistics = "statistics/Ecore/warmup.csv" //give different set up different filenames + output = "output/Ecore/run_time/" +} 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 @@ +/** + */ +package socialnetwork; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Person'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link socialnetwork.Person#getFriends Friends}
  • + *
  • {@link socialnetwork.Person#getName Name}
  • + *
+ * + * @see socialnetwork.SocialnetworkPackage#getPerson() + * @model + * @generated + */ +public interface Person extends EObject { + /** + * Returns the value of the 'Friends' reference list. + * The list contents are of type {@link socialnetwork.Person}. + * + * + * @return the value of the 'Friends' reference list. + * @see socialnetwork.SocialnetworkPackage#getPerson_Friends() + * @model + * @generated + */ + EList getFriends(); + + /** + * Returns the value of the 'Name' attribute. + * The default value is "Name". + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see socialnetwork.SocialnetworkPackage#getPerson_Name() + * @model default="Name" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link socialnetwork.Person#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // 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 @@ +/** + */ +package socialnetwork; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Social Network'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link socialnetwork.SocialNetwork#getName Name}
  • + *
  • {@link socialnetwork.SocialNetwork#getPersons Persons}
  • + *
+ * + * @see socialnetwork.SocialnetworkPackage#getSocialNetwork() + * @model + * @generated + */ +public interface SocialNetwork extends EObject { + /** + * Returns the value of the 'Name' attribute. + * The default value is "SocialNetwork". + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see socialnetwork.SocialnetworkPackage#getSocialNetwork_Name() + * @model default="SocialNetwork" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link socialnetwork.SocialNetwork#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Persons' containment reference list. + * The list contents are of type {@link socialnetwork.Person}. + * + * + * @return the value of the 'Persons' containment reference list. + * @see socialnetwork.SocialnetworkPackage#getSocialNetwork_Persons() + * @model containment="true" + * @generated + */ + EList getPersons(); + +} // 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 @@ +/** + */ +package socialnetwork; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see socialnetwork.SocialnetworkPackage + * @generated + */ +public interface SocialnetworkFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + SocialnetworkFactory eINSTANCE = socialnetwork.impl.SocialnetworkFactoryImpl.init(); + + /** + * Returns a new object of class 'Social Network'. + * + * + * @return a new object of class 'Social Network'. + * @generated + */ + SocialNetwork createSocialNetwork(); + + /** + * Returns a new object of class 'Person'. + * + * + * @return a new object of class 'Person'. + * @generated + */ + Person createPerson(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + SocialnetworkPackage getSocialnetworkPackage(); + +} //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 @@ +/** + */ +package socialnetwork; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see socialnetwork.SocialnetworkFactory + * @model kind="package" + * annotation="http://www.eclipse.org/emf/2002/Ecore" + * @generated + */ +public interface SocialnetworkPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "socialnetwork"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://ecse.mcgill.ca/socialnetwork"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "socialnetwork"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + SocialnetworkPackage eINSTANCE = socialnetwork.impl.SocialnetworkPackageImpl.init(); + + /** + * The meta object id for the '{@link socialnetwork.impl.SocialNetworkImpl Social Network}' class. + * + * + * @see socialnetwork.impl.SocialNetworkImpl + * @see socialnetwork.impl.SocialnetworkPackageImpl#getSocialNetwork() + * @generated + */ + int SOCIAL_NETWORK = 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int SOCIAL_NETWORK__NAME = 0; + + /** + * The feature id for the 'Persons' containment reference list. + * + * + * @generated + * @ordered + */ + int SOCIAL_NETWORK__PERSONS = 1; + + /** + * The number of structural features of the 'Social Network' class. + * + * + * @generated + * @ordered + */ + int SOCIAL_NETWORK_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Social Network' class. + * + * + * @generated + * @ordered + */ + int SOCIAL_NETWORK_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link socialnetwork.impl.PersonImpl Person}' class. + * + * + * @see socialnetwork.impl.PersonImpl + * @see socialnetwork.impl.SocialnetworkPackageImpl#getPerson() + * @generated + */ + int PERSON = 1; + + /** + * The feature id for the 'Friends' reference list. + * + * + * @generated + * @ordered + */ + int PERSON__FRIENDS = 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PERSON__NAME = 1; + + /** + * The number of structural features of the 'Person' class. + * + * + * @generated + * @ordered + */ + int PERSON_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Person' class. + * + * + * @generated + * @ordered + */ + int PERSON_OPERATION_COUNT = 0; + + /** + * Returns the meta object for class '{@link socialnetwork.SocialNetwork Social Network}'. + * + * + * @return the meta object for class 'Social Network'. + * @see socialnetwork.SocialNetwork + * @generated + */ + EClass getSocialNetwork(); + + /** + * Returns the meta object for the attribute '{@link socialnetwork.SocialNetwork#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see socialnetwork.SocialNetwork#getName() + * @see #getSocialNetwork() + * @generated + */ + EAttribute getSocialNetwork_Name(); + + /** + * Returns the meta object for the containment reference list '{@link socialnetwork.SocialNetwork#getPersons Persons}'. + * + * + * @return the meta object for the containment reference list 'Persons'. + * @see socialnetwork.SocialNetwork#getPersons() + * @see #getSocialNetwork() + * @generated + */ + EReference getSocialNetwork_Persons(); + + /** + * Returns the meta object for class '{@link socialnetwork.Person Person}'. + * + * + * @return the meta object for class 'Person'. + * @see socialnetwork.Person + * @generated + */ + EClass getPerson(); + + /** + * Returns the meta object for the reference list '{@link socialnetwork.Person#getFriends Friends}'. + * + * + * @return the meta object for the reference list 'Friends'. + * @see socialnetwork.Person#getFriends() + * @see #getPerson() + * @generated + */ + EReference getPerson_Friends(); + + /** + * Returns the meta object for the attribute '{@link socialnetwork.Person#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see socialnetwork.Person#getName() + * @see #getPerson() + * @generated + */ + EAttribute getPerson_Name(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + SocialnetworkFactory getSocialnetworkFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link socialnetwork.impl.SocialNetworkImpl Social Network}' class. + * + * + * @see socialnetwork.impl.SocialNetworkImpl + * @see socialnetwork.impl.SocialnetworkPackageImpl#getSocialNetwork() + * @generated + */ + EClass SOCIAL_NETWORK = eINSTANCE.getSocialNetwork(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute SOCIAL_NETWORK__NAME = eINSTANCE.getSocialNetwork_Name(); + + /** + * The meta object literal for the 'Persons' containment reference list feature. + * + * + * @generated + */ + EReference SOCIAL_NETWORK__PERSONS = eINSTANCE.getSocialNetwork_Persons(); + + /** + * The meta object literal for the '{@link socialnetwork.impl.PersonImpl Person}' class. + * + * + * @see socialnetwork.impl.PersonImpl + * @see socialnetwork.impl.SocialnetworkPackageImpl#getPerson() + * @generated + */ + EClass PERSON = eINSTANCE.getPerson(); + + /** + * The meta object literal for the 'Friends' reference list feature. + * + * + * @generated + */ + EReference PERSON__FRIENDS = eINSTANCE.getPerson_Friends(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute PERSON__NAME = eINSTANCE.getPerson_Name(); + + } + +} //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 @@ +/** + */ +package socialnetwork.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +import socialnetwork.Person; +import socialnetwork.SocialnetworkPackage; + +/** + * + * An implementation of the model object 'Person'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link socialnetwork.impl.PersonImpl#getFriends Friends}
  • + *
  • {@link socialnetwork.impl.PersonImpl#getName Name}
  • + *
+ * + * @generated + */ +public class PersonImpl extends MinimalEObjectImpl.Container implements Person { + /** + * The cached value of the '{@link #getFriends() Friends}' reference list. + * + * + * @see #getFriends() + * @generated + * @ordered + */ + protected EList friends; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = "Name"; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected PersonImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SocialnetworkPackage.Literals.PERSON; + } + + /** + * + * + * @generated + */ + @Override + public EList getFriends() { + if (friends == null) { + friends = new EObjectResolvingEList(Person.class, this, SocialnetworkPackage.PERSON__FRIENDS); + } + return friends; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SocialnetworkPackage.PERSON__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SocialnetworkPackage.PERSON__FRIENDS: + return getFriends(); + case SocialnetworkPackage.PERSON__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SocialnetworkPackage.PERSON__FRIENDS: + getFriends().clear(); + getFriends().addAll((Collection) newValue); + return; + case SocialnetworkPackage.PERSON__NAME: + setName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SocialnetworkPackage.PERSON__FRIENDS: + getFriends().clear(); + return; + case SocialnetworkPackage.PERSON__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SocialnetworkPackage.PERSON__FRIENDS: + return friends != null && !friends.isEmpty(); + case SocialnetworkPackage.PERSON__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //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 @@ +/** + */ +package socialnetwork.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import socialnetwork.Person; +import socialnetwork.SocialNetwork; +import socialnetwork.SocialnetworkPackage; + +/** + * + * An implementation of the model object 'Social Network'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link socialnetwork.impl.SocialNetworkImpl#getName Name}
  • + *
  • {@link socialnetwork.impl.SocialNetworkImpl#getPersons Persons}
  • + *
+ * + * @generated + */ +public class SocialNetworkImpl extends MinimalEObjectImpl.Container implements SocialNetwork { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = "SocialNetwork"; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getPersons() Persons}' containment reference list. + * + * + * @see #getPersons() + * @generated + * @ordered + */ + protected EList persons; + + /** + * + * + * @generated + */ + protected SocialNetworkImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SocialnetworkPackage.Literals.SOCIAL_NETWORK; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SocialnetworkPackage.SOCIAL_NETWORK__NAME, oldName, + name)); + } + + /** + * + * + * @generated + */ + @Override + public EList getPersons() { + if (persons == null) { + persons = new EObjectContainmentEList(Person.class, this, + SocialnetworkPackage.SOCIAL_NETWORK__PERSONS); + } + return persons; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + return ((InternalEList) getPersons()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__NAME: + return getName(); + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + return getPersons(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__NAME: + setName((String) newValue); + return; + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + getPersons().clear(); + getPersons().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__NAME: + setName(NAME_EDEFAULT); + return; + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + getPersons().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SocialnetworkPackage.SOCIAL_NETWORK__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: + return persons != null && !persons.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //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 @@ +/** + */ +package socialnetwork.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import socialnetwork.*; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class SocialnetworkFactoryImpl extends EFactoryImpl implements SocialnetworkFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static SocialnetworkFactory init() { + try { + SocialnetworkFactory theSocialnetworkFactory = (SocialnetworkFactory) EPackage.Registry.INSTANCE + .getEFactory(SocialnetworkPackage.eNS_URI); + if (theSocialnetworkFactory != null) { + return theSocialnetworkFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new SocialnetworkFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public SocialnetworkFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case SocialnetworkPackage.SOCIAL_NETWORK: + return createSocialNetwork(); + case SocialnetworkPackage.PERSON: + return createPerson(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public SocialNetwork createSocialNetwork() { + SocialNetworkImpl socialNetwork = new SocialNetworkImpl(); + return socialNetwork; + } + + /** + * + * + * @generated + */ + @Override + public Person createPerson() { + PersonImpl person = new PersonImpl(); + return person; + } + + /** + * + * + * @generated + */ + @Override + public SocialnetworkPackage getSocialnetworkPackage() { + return (SocialnetworkPackage) getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static SocialnetworkPackage getPackage() { + return SocialnetworkPackage.eINSTANCE; + } + +} //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 @@ +/** + */ +package socialnetwork.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import socialnetwork.Person; +import socialnetwork.SocialNetwork; +import socialnetwork.SocialnetworkFactory; +import socialnetwork.SocialnetworkPackage; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class SocialnetworkPackageImpl extends EPackageImpl implements SocialnetworkPackage { + /** + * + * + * @generated + */ + private EClass socialNetworkEClass = null; + + /** + * + * + * @generated + */ + private EClass personEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see socialnetwork.SocialnetworkPackage#eNS_URI + * @see #init() + * @generated + */ + private SocialnetworkPackageImpl() { + super(eNS_URI, SocialnetworkFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link SocialnetworkPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static SocialnetworkPackage init() { + if (isInited) + return (SocialnetworkPackage) EPackage.Registry.INSTANCE.getEPackage(SocialnetworkPackage.eNS_URI); + + // Obtain or create and register package + Object registeredSocialnetworkPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + SocialnetworkPackageImpl theSocialnetworkPackage = registeredSocialnetworkPackage instanceof SocialnetworkPackageImpl + ? (SocialnetworkPackageImpl) registeredSocialnetworkPackage + : new SocialnetworkPackageImpl(); + + isInited = true; + + // Create package meta-data objects + theSocialnetworkPackage.createPackageContents(); + + // Initialize created meta-data + theSocialnetworkPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theSocialnetworkPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(SocialnetworkPackage.eNS_URI, theSocialnetworkPackage); + return theSocialnetworkPackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getSocialNetwork() { + return socialNetworkEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getSocialNetwork_Name() { + return (EAttribute) socialNetworkEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getSocialNetwork_Persons() { + return (EReference) socialNetworkEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPerson() { + return personEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getPerson_Friends() { + return (EReference) personEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPerson_Name() { + return (EAttribute) personEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public SocialnetworkFactory getSocialnetworkFactory() { + return (SocialnetworkFactory) getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + socialNetworkEClass = createEClass(SOCIAL_NETWORK); + createEAttribute(socialNetworkEClass, SOCIAL_NETWORK__NAME); + createEReference(socialNetworkEClass, SOCIAL_NETWORK__PERSONS); + + personEClass = createEClass(PERSON); + createEReference(personEClass, PERSON__FRIENDS); + createEAttribute(personEClass, PERSON__NAME); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(socialNetworkEClass, SocialNetwork.class, "SocialNetwork", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getSocialNetwork_Name(), ecorePackage.getEString(), "name", "SocialNetwork", 0, 1, + SocialNetwork.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEReference(getSocialNetwork_Persons(), this.getPerson(), null, "persons", null, 0, -1, SocialNetwork.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPerson_Friends(), this.getPerson(), null, "friends", null, 0, -1, Person.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + initEAttribute(getPerson_Name(), ecorePackage.getEString(), "name", "Name", 0, 1, Person.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http://www.eclipse.org/emf/2002/Ecore + createEcoreAnnotations(); + } + + /** + * Initializes the annotations for http://www.eclipse.org/emf/2002/Ecore. + * + * + * @generated + */ + protected void createEcoreAnnotations() { + String source = "http://www.eclipse.org/emf/2002/Ecore"; + addAnnotation(this, source, new String[] {}); + } + +} //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 @@ +/** + */ +package socialnetwork.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import socialnetwork.*; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see socialnetwork.SocialnetworkPackage + * @generated + */ +public class SocialnetworkAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static SocialnetworkPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public SocialnetworkAdapterFactory() { + if (modelPackage == null) { + modelPackage = SocialnetworkPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected SocialnetworkSwitch modelSwitch = new SocialnetworkSwitch() { + @Override + public Adapter caseSocialNetwork(SocialNetwork object) { + return createSocialNetworkAdapter(); + } + + @Override + public Adapter casePerson(Person object) { + return createPersonAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + /** + * Creates a new adapter for an object of class '{@link socialnetwork.SocialNetwork Social Network}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see socialnetwork.SocialNetwork + * @generated + */ + public Adapter createSocialNetworkAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link socialnetwork.Person Person}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see socialnetwork.Person + * @generated + */ + public Adapter createPersonAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //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 @@ +/** + */ +package socialnetwork.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import socialnetwork.*; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see socialnetwork.SocialnetworkPackage + * @generated + */ +public class SocialnetworkSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static SocialnetworkPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public SocialnetworkSwitch() { + if (modelPackage == null) { + modelPackage = SocialnetworkPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case SocialnetworkPackage.SOCIAL_NETWORK: { + SocialNetwork socialNetwork = (SocialNetwork) theEObject; + T result = caseSocialNetwork(socialNetwork); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case SocialnetworkPackage.PERSON: { + Person person = (Person) theEObject; + T result = casePerson(person); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Social Network'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Social Network'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSocialNetwork(SocialNetwork object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Person'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Person'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePerson(Person object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //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/github.vsconfig b/Metrics/Metrics-Calculation/SocialNetwork_plugin/github.vsconfig new file mode 100644 index 00000000..f037156a --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/github.vsconfig @@ -0,0 +1,212 @@ +import epackage "../../../Domains/github-graph/model/github.ecore" +import viatra "../../../Domains/github-graph/queries/queries/github.vql" + +generate { + metamodel = {package github excluding{ Project.creatd_at, Project.updated_at, Project.url, User.name, User.url, + Commit.created_at, Commit.sha, Commit.parents_sha, Issue.created_at, Issue.url, PullRequest.url, IssueEvent.created_at, + IssueEvent.actor_url, Action, IssueEvent.action, Project.deleted}} + partial-model = { "inputs/github.xmi"} + constraints = { package queries } + + + solver = ViatraSolver + + scope = { + #node = 30 + } + + number = 1 + runs = 5 + config = { + log-level = none, + runtime = 300, + "optional-wf" = "false", + "realistic-guidance" = "Composite", + "allow-must-violations" = "false", + "domain" = "Github" + } + + debug = "debug" + statistics = "statistics/Github/warmup.csv" + output = "output/Github/Composite" +} + +// generate { +// metamodel = {package github excluding{ Project.creatd_at, Project.updated_at, Project.url, User.name, User.url, +// Commit.created_at, Commit.sha, Commit.parents_sha, Issue.created_at, Issue.url, PullRequest.url, IssueEvent.created_at, +// IssueEvent.actor_url, Action, IssueEvent.action, Project.deleted}} +// partial-model = { "inputs/github.xmi"} +// constraints = { package queries } + + +// solver = ViatraSolver + +// scope = { +// #node = 30 +// } + +// number = 1 +// runs = 20 +// config = { +// log-level = none, +// runtime = 300, +// "optional-wf" = "true", +// "realistic-guidance" = "Composite", +// "allow-must-violations" = "true", +// "domain" = "Github" +// } + +// debug = "debug" +// statistics = "statistics/Github/30.csv" +// output = "output/Github/Composite" +// } + +// generate { +// metamodel = {package github excluding{ Project.creatd_at, Project.updated_at, Project.url, User.name, User.url, +// Commit.created_at, Commit.sha, Commit.parents_sha, Issue.created_at, Issue.url, PullRequest.url, IssueEvent.created_at, +// IssueEvent.actor_url, Action, IssueEvent.action, Project.deleted}} +// partial-model = { "inputs/github.xmi"} +// constraints = { package queries } + + +// solver = ViatraSolver + +// scope = { +// #node = 50 +// } + +// number = 1 +// runs = 20 +// config = { +// log-level = none, +// runtime = 300, +// "optional-wf" = "true", +// "realistic-guidance" = "Composite", +// "allow-must-violations" = "true", +// "domain" = "Github" +// } + +// debug = "debug" +// statistics = "statistics/Github/50.csv" +// output = "output/Github/Composite" +// } + +// generate { +// metamodel = {package github excluding{ Project.creatd_at, Project.updated_at, Project.url, User.name, User.url, +// Commit.created_at, Commit.sha, Commit.parents_sha, Issue.created_at, Issue.url, PullRequest.url, IssueEvent.created_at, +// IssueEvent.actor_url, Action, IssueEvent.action, Project.deleted}} +// partial-model = { "inputs/github.xmi"} +// constraints = { package queries } + + +// solver = ViatraSolver + +// scope = { +// #node = 80 +// } + +// number = 1 +// runs = 20 +// config = { +// log-level = none, +// runtime = 300, +// "optional-wf" = "true", +// "realistic-guidance" = "Composite", +// "allow-must-violations" = "true", +// "domain" = "Github" +// } + +// debug = "debug" +// statistics = "statistics/Github/80.csv" +// output = "output/Github/Composite" +// } + +// generate { +// metamodel = {package github excluding{ Project.creatd_at, Project.updated_at, Project.url, User.name, User.url, +// Commit.created_at, Commit.sha, Commit.parents_sha, Issue.created_at, Issue.url, PullRequest.url, IssueEvent.created_at, +// IssueEvent.actor_url, Action, IssueEvent.action, Project.deleted}} +// partial-model = { "inputs/github.xmi"} +// constraints = { package queries } + + +// solver = ViatraSolver + +// scope = { +// #node = 100 +// } + +// number = 1 +// runs = 20 +// config = { +// log-level = none, +// runtime = 300, +// "optional-wf" = "true", +// "realistic-guidance" = "Composite", +// "allow-must-violations" = "true", +// "domain" = "Github" +// } + +// debug = "debug" +// statistics = "statistics/Github/100.csv" +// output = "output/Github/Composite" +// } + +// generate { +// metamodel = {package github excluding{ Project.creatd_at, Project.updated_at, Project.url, User.name, User.url, +// Commit.created_at, Commit.sha, Commit.parents_sha, Issue.created_at, Issue.url, PullRequest.url, IssueEvent.created_at, +// IssueEvent.actor_url, Action, IssueEvent.action, Project.deleted}} +// partial-model = { "inputs/github.xmi"} +// constraints = { package queries } + + +// solver = ViatraSolver + +// scope = { +// #node = 120 +// } + +// number = 1 +// runs = 20 +// config = { +// log-level = none, +// runtime = 300, +// "optional-wf" = "true", +// "realistic-guidance" = "Composite", +// "allow-must-violations" = "true", +// "domain" = "Github" +// } + +// debug = "debug" +// statistics = "statistics/Github/120.csv" +// output = "output/Github/Composite" +// } + +// generate { +// metamodel = {package github excluding{ Project.creatd_at, Project.updated_at, Project.url, User.name, User.url, +// Commit.created_at, Commit.sha, Commit.parents_sha, Issue.created_at, Issue.url, PullRequest.url, IssueEvent.created_at, +// IssueEvent.actor_url, Action, IssueEvent.action, Project.deleted}} +// partial-model = { "inputs/github.xmi"} +// constraints = { package queries } + + +// solver = ViatraSolver + +// scope = { +// #node = 140 +// } + +// number = 1 +// runs = 20 +// config = { +// log-level = none, +// runtime = 300, +// "optional-wf" = "true", +// "realistic-guidance" = "Composite", +// "allow-must-violations" = "true", +// "domain" = "Github" +// } + +// debug = "debug" +// statistics = "statistics/Github/140.csv" +// output = "output/Github/Composite" +// } \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/ecore.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/ecore.xmi new file mode 100644 index 00000000..c5721309 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/ecore.xmi @@ -0,0 +1,5 @@ + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/github.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/github.xmi new file mode 100644 index 00000000..ad497607 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/github.xmi @@ -0,0 +1,3 @@ + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/start.xmi b/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/start.xmi new file mode 100644 index 00000000..f9a2a185 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/inputs/start.xmi @@ -0,0 +1,2 @@ + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/ecore.ecore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/ecore.ecore new file mode 100644 index 00000000..eaaf3d11 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/ecore.ecore @@ -0,0 +1,1023 @@ + + + + +

+
+ + +
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + +
+
+ + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + + +
+
+ + +
+ + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + + + + + +
+
+ + + +
+
+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + + +
+
+ + +
+ + + + + + + + + + + + +
+
+ + + + + +
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + + + + + + + + + + + + + +
+
+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + +
+
+ + + + +
+ + + + +
+ + + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + + + +
+
+ + + + + + +
+
+ + + + + +
+
+ + +
+ + + +
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + + + + + +
+
+ + +
+ + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + +
+ + + + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+ + + + + +
+
+ + +
+ + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + 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 @@ + + + + socialnetwork.ecore + socialnetwork.genmodel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + KEEP_LOCATION + KEEP_SIZE + KEEP_RATIO + + + + + + + + + + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + 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 @@ + + + socialnetwork.ecore + + + + + + + + + + + + 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 Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/200_nodes.jpg 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 Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/220_nodes.jpg 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 Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/260_nodes.jpg 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 Binary files /dev/null and b/Metrics/Metrics-Calculation/SocialNetwork_plugin/model/statistics/280_nodes.jpg 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 +9 +7 +0 +4 +6 +16 +0 +2 +4 +17 +20 +1 +5 +2 +3 +11 +6 +4 +0 +2 +1 +3 +5 +9 +13 +11 +0 +1 +10 +3 +0 +1 +1 +0 +17 +0 +4 +2 +0 +1 +10 +10 +0 +24 +9 +0 +14 +1 +11 +2 +17 +3 +3 +3 +0 +3 +1 +3 +2 +2 +1 +0 +3 +6 +3 +16 +3 +10 +6 +6 +6 +11 +6 +10 +20 +1 +4 +13 +0 +0 +3 +2 +0 +12 +0 +0 +22 +4 +0 +0 +20 +1 +10 +9 +11 +5 +27 +1 +3 +9 +0 +23 +10 +9 +23 +0 +3 +7 +2 +0 +9 +3 +0 +12 +11 +7 +6 +9 +2 +0 +3 +4 +3 +9 +3 +0 +7 +2 +1 +9 +1 +11 +6 +5 +16 +0 +19 +14 +9 +13 +2 +8 +0 +6 +1 +1 +2 +0 +3 +15 +3 +0 +3 +17 +1 +15 +5 +1 +21 +8 +2 +7 +3 +16 +11 +1 +5 +1 +5 +1 +6 +3 +16 +6 +17 +3 +5 +7 +2 +9 +2 +1 +11 +1 +0 +3 +5 +6 +2 +5 +1 +4 +9 +0 +11 +1 +10 +13 +6 +2 +1 +3 +4 +0 +1 +2 +10 +12 +3 +3 +3 +0 +2 +4 +2 +18 +3 +8 +7 +5 +3 +16 +1 +4 +8 +15 +1 +11 +15 +1 +8 +7 +1 +2 +0 +9 +5 +2 +1 +3 +6 +4 +8 +3 +12 +4 +21 +9 +2 +3 +2 +1 +3 +11 +2 +9 +0 +10 +6 +1 +2 +0 +8 +5 +2 +3 +8 +1 +13 +8 +2 +2 +11 +4 +21 +6 +5 +0 +8 +8 +12 +0 +0 +4 +1 +19 +5 +3 +1 +3 +12 +2 +6 +11 +8 +8 +2 +18 +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 @@ +clear; +clc; + +matrix = load('-ascii', "output.txt"); +hist(matrix,unique(matrix)); +hold on; +[a,b] = hist(matrix,unique(matrix)) +plot(b, a) +hold off; +sum(matrix) +average = sum(matrix) / length(matrix) \ No newline at end of file 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 @@ +# ignore everything in this folder except for this folder it self + +* +!.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 @@ +# + +pluginName = SocialNetwork_plugin +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..86211808 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/plugin.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/queries/queries/Ecore.vql b/Metrics/Metrics-Calculation/SocialNetwork_plugin/queries/queries/Ecore.vql new file mode 100644 index 00000000..9ddb64c9 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/queries/queries/Ecore.vql @@ -0,0 +1,33 @@ +package queries + +import epackage "http://www.eclipse.org/emf/2002/Ecore" + +pattern directSupertype(a: EClass, b:EClass) { + EClass.eSuperTypes(a,b); +} + +@Constraint(key={a}, severity="error", message="error") +pattern loopInInheritence(a: EClass) { + find directSupertype+(a,a); +} + +pattern opposite(a:EReference, b: EReference) { + EReference.eOpposite(a,b); +} +@Constraint(key={a}, severity="error", message="error") +pattern oppositeDifferentClass(a:EReference) { + EReference.eOpposite(a,b); + EReference.eContainingClass(a,aContaining); + EReference.eType(b,bTarget); + aContaining != bTarget; +} + +@Constraint(key={a}, severity="error", message="error") +pattern nonSymmetricOpposite(a:EReference, b:EReference) { + find opposite(a,b); + neg find opposite(b,a); +} + +pattern superTypes(c1:EClass, c2:EClass){ + EClass.eSuperTypes(c1,c2); +} 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 @@ +/.Friendship.java._trace +/.NoFriend.java._trace +/.Queries.java._trace +/.SelfFriend.java._trace +/.SingleFriendship.java._trace +/Friendship.java +/NoFriend.java +/Queries.java +/SelfFriend.java +/SingleFriendship.java diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/constraints/ecore/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/constraints/ecore/.gitignore new file mode 100644 index 00000000..c42ca056 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/constraints/ecore/.gitignore @@ -0,0 +1,8 @@ +/.Ecore_pattern.java._trace +/.MoreThenFiveSuperTypes.java._trace +/.DirectSupertype.java._trace +/.Ecore.java._trace +/.LoopInInheritence.java._trace +/.NonSymmetricOpposite.java._trace +/.Opposite.java._trace +/.OppositeDifferentClass.java._trace diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/ecore/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/ecore/.gitignore new file mode 100644 index 00000000..c42ca056 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/ecore/.gitignore @@ -0,0 +1,8 @@ +/.Ecore_pattern.java._trace +/.MoreThenFiveSuperTypes.java._trace +/.DirectSupertype.java._trace +/.Ecore.java._trace +/.LoopInInheritence.java._trace +/.NonSymmetricOpposite.java._trace +/.Opposite.java._trace +/.OppositeDifferentClass.java._trace diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/.gitignore new file mode 100644 index 00000000..e9d711d4 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/.gitignore @@ -0,0 +1,9 @@ +/.Ecore_pattern.java._trace +/.MoreThenFiveSuperTypes.java._trace +/.DirectSupertype.java._trace +/.Ecore.java._trace +/.LoopInInheritence.java._trace +/.NonSymmetricOpposite.java._trace +/.Opposite.java._trace +/.OppositeDifferentClass.java._trace +/.SuperTypes.java._trace diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/DirectSupertype.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/DirectSupertype.java new file mode 100644 index 00000000..a557d865 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/DirectSupertype.java @@ -0,0 +1,703 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql + */ +package queries; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         pattern directSupertype(a: EClass, b:EClass) {
+ *         	EClass.eSuperTypes(a,b);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class DirectSupertype extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the queries.directSupertype pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EClass fA; + + private EClass fB; + + private static List parameterNames = makeImmutableList("a", "b"); + + private Match(final EClass pA, final EClass pB) { + this.fA = pA; + this.fB = pB; + } + + @Override + public Object get(final String parameterName) { + switch(parameterName) { + case "a": return this.fA; + case "b": return this.fB; + default: return null; + } + } + + @Override + public Object get(final int index) { + switch(index) { + case 0: return this.fA; + case 1: return this.fB; + default: return null; + } + } + + public EClass getA() { + return this.fA; + } + + public EClass getB() { + return this.fB; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EClass) newValue; + return true; + } + if ("b".equals(parameterName) ) { + this.fB = (EClass) newValue; + return true; + } + return false; + } + + public void setA(final EClass pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + public void setB(final EClass pB) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fB = pB; + } + + @Override + public String patternName() { + return "queries.directSupertype"; + } + + @Override + public List parameterNames() { + return DirectSupertype.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA, fB}; + } + + @Override + public DirectSupertype.Match toImmutable() { + return isMutable() ? newMatch(fA, fB) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA) + ", "); + result.append("\"b\"=" + prettyPrintValue(fB)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA, fB); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof DirectSupertype.Match)) { + DirectSupertype.Match other = (DirectSupertype.Match) obj; + return Objects.equals(fA, other.fA) && Objects.equals(fB, other.fB); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public DirectSupertype specification() { + return DirectSupertype.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static DirectSupertype.Match newEmptyMatch() { + return new Mutable(null, null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static DirectSupertype.Match newMutableMatch(final EClass pA, final EClass pB) { + return new Mutable(pA, pB); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public static DirectSupertype.Match newMatch(final EClass pA, final EClass pB) { + return new Immutable(pA, pB); + } + + private static final class Mutable extends DirectSupertype.Match { + Mutable(final EClass pA, final EClass pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends DirectSupertype.Match { + Immutable(final EClass pA, final EClass pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the queries.directSupertype pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * pattern directSupertype(a: EClass, b:EClass) {
+   * 	EClass.eSuperTypes(a,b);
+   * }
+   * 
+ * + * @see Match + * @see DirectSupertype + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static DirectSupertype.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static DirectSupertype.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final int POSITION_B = 1; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(DirectSupertype.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EClass pA, final EClass pB) { + return rawStreamAllMatches(new Object[]{pA, pB}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EClass pA, final EClass pB) { + return rawStreamAllMatches(new Object[]{pA, pB}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EClass pA, final EClass pB) { + return rawGetOneArbitraryMatch(new Object[]{pA, pB}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EClass pA, final EClass pB) { + return rawHasMatch(new Object[]{pA, pB}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EClass pA, final EClass pB) { + return rawCountMatches(new Object[]{pA, pB}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EClass pA, final EClass pB, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA, pB}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public DirectSupertype.Match newMatch(final EClass pA, final EClass pB) { + return DirectSupertype.Match.newMatch(pA, pB); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EClass.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final DirectSupertype.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final EClass pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final DirectSupertype.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final EClass pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfb(final Object[] parameters) { + return rawStreamAllValues(POSITION_B, parameters).map(EClass.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final DirectSupertype.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final EClass pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final DirectSupertype.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final EClass pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}).collect(Collectors.toSet()); + } + + @Override + protected DirectSupertype.Match tupleToMatch(final Tuple t) { + try { + return DirectSupertype.Match.newMatch((EClass) t.get(POSITION_A), (EClass) t.get(POSITION_B)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected DirectSupertype.Match arrayToMatch(final Object[] match) { + try { + return DirectSupertype.Match.newMatch((EClass) match[POSITION_A], (EClass) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected DirectSupertype.Match arrayToMatchMutable(final Object[] match) { + try { + return DirectSupertype.Match.newMutableMatch((EClass) match[POSITION_A], (EClass) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return DirectSupertype.instance(); + } + } + + private DirectSupertype() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static DirectSupertype instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected DirectSupertype.Matcher instantiate(final ViatraQueryEngine engine) { + return DirectSupertype.Matcher.on(engine); + } + + @Override + public DirectSupertype.Matcher instantiate() { + return DirectSupertype.Matcher.create(); + } + + @Override + public DirectSupertype.Match newEmptyMatch() { + return DirectSupertype.Match.newEmptyMatch(); + } + + @Override + public DirectSupertype.Match newMatch(final Object... parameters) { + return DirectSupertype.Match.newMatch((org.eclipse.emf.ecore.EClass) parameters[0], (org.eclipse.emf.ecore.EClass) parameters[1]); + } + + /** + * Inner class allowing the singleton instance of {@link DirectSupertype} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link DirectSupertype#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final DirectSupertype INSTANCE = new DirectSupertype(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final DirectSupertype.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); + + private final PParameter parameter_b = new PParameter("b", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a, parameter_b); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "queries.directSupertype"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a","b"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + PVariable var_b = body.getOrCreateVariableByName("b"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a), + new ExportedParameter(body, var_b, parameter_b) + )); + // EClass.eSuperTypes(a,b) + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass", "eSuperTypes"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + new Equality(body, var__virtual_0_, var_b); + bodies.add(body); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/Ecore.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/Ecore.java new file mode 100644 index 00000000..adfa5cf8 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/Ecore.java @@ -0,0 +1,108 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql + */ +package queries; + +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; +import queries.DirectSupertype; +import queries.LoopInInheritence; +import queries.NonSymmetricOpposite; +import queries.Opposite; +import queries.OppositeDifferentClass; +import queries.SuperTypes; + +/** + * A pattern group formed of all public patterns defined in Ecore.vql. + * + *

Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare + * a VIATRA Query engine for matching all patterns originally defined in file Ecore.vql, + * in order to achieve better performance than one-by-one on-demand matcher initialization. + * + *

From package queries, the group contains the definition of the following patterns:

    + *
  • directSupertype
  • + *
  • loopInInheritence
  • + *
  • opposite
  • + *
  • oppositeDifferentClass
  • + *
  • nonSymmetricOpposite
  • + *
  • superTypes
  • + *
+ * + * @see IQueryGroup + * + */ +@SuppressWarnings("all") +public final class Ecore extends BaseGeneratedPatternGroup { + /** + * Access the pattern group. + * + * @return the singleton instance of the group + * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications + * + */ + public static Ecore instance() { + if (INSTANCE == null) { + INSTANCE = new Ecore(); + } + return INSTANCE; + } + + private static Ecore INSTANCE; + + private Ecore() { + querySpecifications.add(DirectSupertype.instance()); + querySpecifications.add(LoopInInheritence.instance()); + querySpecifications.add(Opposite.instance()); + querySpecifications.add(OppositeDifferentClass.instance()); + querySpecifications.add(NonSymmetricOpposite.instance()); + querySpecifications.add(SuperTypes.instance()); + } + + public DirectSupertype getDirectSupertype() { + return DirectSupertype.instance(); + } + + public DirectSupertype.Matcher getDirectSupertype(final ViatraQueryEngine engine) { + return DirectSupertype.Matcher.on(engine); + } + + public LoopInInheritence getLoopInInheritence() { + return LoopInInheritence.instance(); + } + + public LoopInInheritence.Matcher getLoopInInheritence(final ViatraQueryEngine engine) { + return LoopInInheritence.Matcher.on(engine); + } + + public Opposite getOpposite() { + return Opposite.instance(); + } + + public Opposite.Matcher getOpposite(final ViatraQueryEngine engine) { + return Opposite.Matcher.on(engine); + } + + public OppositeDifferentClass getOppositeDifferentClass() { + return OppositeDifferentClass.instance(); + } + + public OppositeDifferentClass.Matcher getOppositeDifferentClass(final ViatraQueryEngine engine) { + return OppositeDifferentClass.Matcher.on(engine); + } + + public NonSymmetricOpposite getNonSymmetricOpposite() { + return NonSymmetricOpposite.instance(); + } + + public NonSymmetricOpposite.Matcher getNonSymmetricOpposite(final ViatraQueryEngine engine) { + return NonSymmetricOpposite.Matcher.on(engine); + } + + public SuperTypes getSuperTypes() { + return SuperTypes.instance(); + } + + public SuperTypes.Matcher getSuperTypes(final ViatraQueryEngine engine) { + return SuperTypes.Matcher.on(engine); + } +} diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/LoopInInheritence.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/LoopInInheritence.java new file mode 100644 index 00000000..5212e3d2 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/LoopInInheritence.java @@ -0,0 +1,558 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql + */ +package queries; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.BinaryTransitiveClosure; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import queries.DirectSupertype; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         {@literal @}Constraint(key={a}, severity="error", message="error")
+ *         pattern loopInInheritence(a: EClass) {
+ *         	find directSupertype+(a,a);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class LoopInInheritence extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the queries.loopInInheritence pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EClass fA; + + private static List parameterNames = makeImmutableList("a"); + + private Match(final EClass pA) { + this.fA = pA; + } + + @Override + public Object get(final String parameterName) { + switch(parameterName) { + case "a": return this.fA; + default: return null; + } + } + + @Override + public Object get(final int index) { + switch(index) { + case 0: return this.fA; + default: return null; + } + } + + public EClass getA() { + return this.fA; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EClass) newValue; + return true; + } + return false; + } + + public void setA(final EClass pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + @Override + public String patternName() { + return "queries.loopInInheritence"; + } + + @Override + public List parameterNames() { + return LoopInInheritence.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA}; + } + + @Override + public LoopInInheritence.Match toImmutable() { + return isMutable() ? newMatch(fA) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof LoopInInheritence.Match)) { + LoopInInheritence.Match other = (LoopInInheritence.Match) obj; + return Objects.equals(fA, other.fA); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public LoopInInheritence specification() { + return LoopInInheritence.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static LoopInInheritence.Match newEmptyMatch() { + return new Mutable(null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static LoopInInheritence.Match newMutableMatch(final EClass pA) { + return new Mutable(pA); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the (partial) match object. + * + */ + public static LoopInInheritence.Match newMatch(final EClass pA) { + return new Immutable(pA); + } + + private static final class Mutable extends LoopInInheritence.Match { + Mutable(final EClass pA) { + super(pA); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends LoopInInheritence.Match { + Immutable(final EClass pA) { + super(pA); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the queries.loopInInheritence pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * {@literal @}Constraint(key={a}, severity="error", message="error")
+   * pattern loopInInheritence(a: EClass) {
+   * 	find directSupertype+(a,a);
+   * }
+   * 
+ * + * @see Match + * @see LoopInInheritence + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static LoopInInheritence.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static LoopInInheritence.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(LoopInInheritence.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EClass pA) { + return rawStreamAllMatches(new Object[]{pA}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EClass pA) { + return rawStreamAllMatches(new Object[]{pA}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EClass pA) { + return rawGetOneArbitraryMatch(new Object[]{pA}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EClass pA) { + return rawHasMatch(new Object[]{pA}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EClass pA) { + return rawCountMatches(new Object[]{pA}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EClass pA, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the (partial) match object. + * + */ + public LoopInInheritence.Match newMatch(final EClass pA) { + return LoopInInheritence.Match.newMatch(pA); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EClass.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + @Override + protected LoopInInheritence.Match tupleToMatch(final Tuple t) { + try { + return LoopInInheritence.Match.newMatch((EClass) t.get(POSITION_A)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected LoopInInheritence.Match arrayToMatch(final Object[] match) { + try { + return LoopInInheritence.Match.newMatch((EClass) match[POSITION_A]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected LoopInInheritence.Match arrayToMatchMutable(final Object[] match) { + try { + return LoopInInheritence.Match.newMutableMatch((EClass) match[POSITION_A]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return LoopInInheritence.instance(); + } + } + + private LoopInInheritence() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static LoopInInheritence instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected LoopInInheritence.Matcher instantiate(final ViatraQueryEngine engine) { + return LoopInInheritence.Matcher.on(engine); + } + + @Override + public LoopInInheritence.Matcher instantiate() { + return LoopInInheritence.Matcher.create(); + } + + @Override + public LoopInInheritence.Match newEmptyMatch() { + return LoopInInheritence.Match.newEmptyMatch(); + } + + @Override + public LoopInInheritence.Match newMatch(final Object... parameters) { + return LoopInInheritence.Match.newMatch((org.eclipse.emf.ecore.EClass) parameters[0]); + } + + /** + * Inner class allowing the singleton instance of {@link LoopInInheritence} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link LoopInInheritence#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final LoopInInheritence INSTANCE = new LoopInInheritence(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final LoopInInheritence.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "queries.loopInInheritence"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a) + )); + // find directSupertype+(a,a) + new BinaryTransitiveClosure(body, Tuples.flatTupleOf(var_a, var_a), DirectSupertype.instance().getInternalQueryRepresentation()); + bodies.add(body); + } + { + PAnnotation annotation = new PAnnotation("Constraint"); + annotation.addAttribute("key", Arrays.asList(new Object[] { + new ParameterReference("a") + })); + annotation.addAttribute("severity", "error"); + annotation.addAttribute("message", "error"); + addAnnotation(annotation); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/NonSymmetricOpposite.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/NonSymmetricOpposite.java new file mode 100644 index 00000000..c98014f5 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/NonSymmetricOpposite.java @@ -0,0 +1,718 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql + */ +package queries; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import queries.Opposite; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         {@literal @}Constraint(key={a}, severity="error", message="error")
+ *         pattern nonSymmetricOpposite(a:EReference, b:EReference) {
+ *         	find opposite(a,b);
+ *         	neg find opposite(b,a);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class NonSymmetricOpposite extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the queries.nonSymmetricOpposite pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EReference fA; + + private EReference fB; + + private static List parameterNames = makeImmutableList("a", "b"); + + private Match(final EReference pA, final EReference pB) { + this.fA = pA; + this.fB = pB; + } + + @Override + public Object get(final String parameterName) { + switch(parameterName) { + case "a": return this.fA; + case "b": return this.fB; + default: return null; + } + } + + @Override + public Object get(final int index) { + switch(index) { + case 0: return this.fA; + case 1: return this.fB; + default: return null; + } + } + + public EReference getA() { + return this.fA; + } + + public EReference getB() { + return this.fB; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EReference) newValue; + return true; + } + if ("b".equals(parameterName) ) { + this.fB = (EReference) newValue; + return true; + } + return false; + } + + public void setA(final EReference pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + public void setB(final EReference pB) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fB = pB; + } + + @Override + public String patternName() { + return "queries.nonSymmetricOpposite"; + } + + @Override + public List parameterNames() { + return NonSymmetricOpposite.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA, fB}; + } + + @Override + public NonSymmetricOpposite.Match toImmutable() { + return isMutable() ? newMatch(fA, fB) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA) + ", "); + result.append("\"b\"=" + prettyPrintValue(fB)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA, fB); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof NonSymmetricOpposite.Match)) { + NonSymmetricOpposite.Match other = (NonSymmetricOpposite.Match) obj; + return Objects.equals(fA, other.fA) && Objects.equals(fB, other.fB); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public NonSymmetricOpposite specification() { + return NonSymmetricOpposite.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static NonSymmetricOpposite.Match newEmptyMatch() { + return new Mutable(null, null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static NonSymmetricOpposite.Match newMutableMatch(final EReference pA, final EReference pB) { + return new Mutable(pA, pB); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public static NonSymmetricOpposite.Match newMatch(final EReference pA, final EReference pB) { + return new Immutable(pA, pB); + } + + private static final class Mutable extends NonSymmetricOpposite.Match { + Mutable(final EReference pA, final EReference pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends NonSymmetricOpposite.Match { + Immutable(final EReference pA, final EReference pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the queries.nonSymmetricOpposite pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * {@literal @}Constraint(key={a}, severity="error", message="error")
+   * pattern nonSymmetricOpposite(a:EReference, b:EReference) {
+   * 	find opposite(a,b);
+   * 	neg find opposite(b,a);
+   * }
+   * 
+ * + * @see Match + * @see NonSymmetricOpposite + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static NonSymmetricOpposite.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static NonSymmetricOpposite.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final int POSITION_B = 1; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NonSymmetricOpposite.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EReference pA, final EReference pB) { + return rawStreamAllMatches(new Object[]{pA, pB}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EReference pA, final EReference pB) { + return rawStreamAllMatches(new Object[]{pA, pB}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EReference pA, final EReference pB) { + return rawGetOneArbitraryMatch(new Object[]{pA, pB}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EReference pA, final EReference pB) { + return rawHasMatch(new Object[]{pA, pB}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EReference pA, final EReference pB) { + return rawCountMatches(new Object[]{pA, pB}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EReference pA, final EReference pB, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA, pB}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public NonSymmetricOpposite.Match newMatch(final EReference pA, final EReference pB) { + return NonSymmetricOpposite.Match.newMatch(pA, pB); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final NonSymmetricOpposite.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final EReference pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final NonSymmetricOpposite.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final EReference pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfb(final Object[] parameters) { + return rawStreamAllValues(POSITION_B, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final NonSymmetricOpposite.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final EReference pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final NonSymmetricOpposite.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final EReference pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}).collect(Collectors.toSet()); + } + + @Override + protected NonSymmetricOpposite.Match tupleToMatch(final Tuple t) { + try { + return NonSymmetricOpposite.Match.newMatch((EReference) t.get(POSITION_A), (EReference) t.get(POSITION_B)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected NonSymmetricOpposite.Match arrayToMatch(final Object[] match) { + try { + return NonSymmetricOpposite.Match.newMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected NonSymmetricOpposite.Match arrayToMatchMutable(final Object[] match) { + try { + return NonSymmetricOpposite.Match.newMutableMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return NonSymmetricOpposite.instance(); + } + } + + private NonSymmetricOpposite() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static NonSymmetricOpposite instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected NonSymmetricOpposite.Matcher instantiate(final ViatraQueryEngine engine) { + return NonSymmetricOpposite.Matcher.on(engine); + } + + @Override + public NonSymmetricOpposite.Matcher instantiate() { + return NonSymmetricOpposite.Matcher.create(); + } + + @Override + public NonSymmetricOpposite.Match newEmptyMatch() { + return NonSymmetricOpposite.Match.newEmptyMatch(); + } + + @Override + public NonSymmetricOpposite.Match newMatch(final Object... parameters) { + return NonSymmetricOpposite.Match.newMatch((org.eclipse.emf.ecore.EReference) parameters[0], (org.eclipse.emf.ecore.EReference) parameters[1]); + } + + /** + * Inner class allowing the singleton instance of {@link NonSymmetricOpposite} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link NonSymmetricOpposite#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final NonSymmetricOpposite INSTANCE = new NonSymmetricOpposite(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final NonSymmetricOpposite.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final PParameter parameter_b = new PParameter("b", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a, parameter_b); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "queries.nonSymmetricOpposite"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a","b"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + PVariable var_b = body.getOrCreateVariableByName("b"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a), + new ExportedParameter(body, var_b, parameter_b) + )); + // find opposite(a,b) + new PositivePatternCall(body, Tuples.flatTupleOf(var_a, var_b), Opposite.instance().getInternalQueryRepresentation()); + // neg find opposite(b,a) + new NegativePatternCall(body, Tuples.flatTupleOf(var_b, var_a), Opposite.instance().getInternalQueryRepresentation()); + bodies.add(body); + } + { + PAnnotation annotation = new PAnnotation("Constraint"); + annotation.addAttribute("key", Arrays.asList(new Object[] { + new ParameterReference("a") + })); + annotation.addAttribute("severity", "error"); + annotation.addAttribute("message", "error"); + addAnnotation(annotation); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/Opposite.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/Opposite.java new file mode 100644 index 00000000..ab808e10 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/Opposite.java @@ -0,0 +1,704 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql + */ +package queries; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         pattern opposite(a:EReference, b: EReference) {
+ *         	EReference.eOpposite(a,b);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class Opposite extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the queries.opposite pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EReference fA; + + private EReference fB; + + private static List parameterNames = makeImmutableList("a", "b"); + + private Match(final EReference pA, final EReference pB) { + this.fA = pA; + this.fB = pB; + } + + @Override + public Object get(final String parameterName) { + switch(parameterName) { + case "a": return this.fA; + case "b": return this.fB; + default: return null; + } + } + + @Override + public Object get(final int index) { + switch(index) { + case 0: return this.fA; + case 1: return this.fB; + default: return null; + } + } + + public EReference getA() { + return this.fA; + } + + public EReference getB() { + return this.fB; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EReference) newValue; + return true; + } + if ("b".equals(parameterName) ) { + this.fB = (EReference) newValue; + return true; + } + return false; + } + + public void setA(final EReference pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + public void setB(final EReference pB) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fB = pB; + } + + @Override + public String patternName() { + return "queries.opposite"; + } + + @Override + public List parameterNames() { + return Opposite.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA, fB}; + } + + @Override + public Opposite.Match toImmutable() { + return isMutable() ? newMatch(fA, fB) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA) + ", "); + result.append("\"b\"=" + prettyPrintValue(fB)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA, fB); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof Opposite.Match)) { + Opposite.Match other = (Opposite.Match) obj; + return Objects.equals(fA, other.fA) && Objects.equals(fB, other.fB); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public Opposite specification() { + return Opposite.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static Opposite.Match newEmptyMatch() { + return new Mutable(null, null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static Opposite.Match newMutableMatch(final EReference pA, final EReference pB) { + return new Mutable(pA, pB); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public static Opposite.Match newMatch(final EReference pA, final EReference pB) { + return new Immutable(pA, pB); + } + + private static final class Mutable extends Opposite.Match { + Mutable(final EReference pA, final EReference pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends Opposite.Match { + Immutable(final EReference pA, final EReference pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the queries.opposite pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * pattern opposite(a:EReference, b: EReference) {
+   * 	EReference.eOpposite(a,b);
+   * }
+   * 
+ * + * @see Match + * @see Opposite + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static Opposite.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static Opposite.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final int POSITION_B = 1; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Opposite.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EReference pA, final EReference pB) { + return rawStreamAllMatches(new Object[]{pA, pB}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EReference pA, final EReference pB) { + return rawStreamAllMatches(new Object[]{pA, pB}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EReference pA, final EReference pB) { + return rawGetOneArbitraryMatch(new Object[]{pA, pB}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EReference pA, final EReference pB) { + return rawHasMatch(new Object[]{pA, pB}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EReference pA, final EReference pB) { + return rawCountMatches(new Object[]{pA, pB}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EReference pA, final EReference pB, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA, pB}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public Opposite.Match newMatch(final EReference pA, final EReference pB) { + return Opposite.Match.newMatch(pA, pB); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final Opposite.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final EReference pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final Opposite.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final EReference pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfb(final Object[] parameters) { + return rawStreamAllValues(POSITION_B, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final Opposite.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final EReference pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final Opposite.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final EReference pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}).collect(Collectors.toSet()); + } + + @Override + protected Opposite.Match tupleToMatch(final Tuple t) { + try { + return Opposite.Match.newMatch((EReference) t.get(POSITION_A), (EReference) t.get(POSITION_B)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected Opposite.Match arrayToMatch(final Object[] match) { + try { + return Opposite.Match.newMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected Opposite.Match arrayToMatchMutable(final Object[] match) { + try { + return Opposite.Match.newMutableMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return Opposite.instance(); + } + } + + private Opposite() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static Opposite instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected Opposite.Matcher instantiate(final ViatraQueryEngine engine) { + return Opposite.Matcher.on(engine); + } + + @Override + public Opposite.Matcher instantiate() { + return Opposite.Matcher.create(); + } + + @Override + public Opposite.Match newEmptyMatch() { + return Opposite.Match.newEmptyMatch(); + } + + @Override + public Opposite.Match newMatch(final Object... parameters) { + return Opposite.Match.newMatch((org.eclipse.emf.ecore.EReference) parameters[0], (org.eclipse.emf.ecore.EReference) parameters[1]); + } + + /** + * Inner class allowing the singleton instance of {@link Opposite} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link Opposite#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final Opposite INSTANCE = new Opposite(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final Opposite.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final PParameter parameter_b = new PParameter("b", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a, parameter_b); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "queries.opposite"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a","b"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + PVariable var_b = body.getOrCreateVariableByName("b"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a), + new ExportedParameter(body, var_b, parameter_b) + )); + // EReference.eOpposite(a,b) + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference", "eOpposite"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + new Equality(body, var__virtual_0_, var_b); + bodies.add(body); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/OppositeDifferentClass.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/OppositeDifferentClass.java new file mode 100644 index 00000000..ff46566d --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/OppositeDifferentClass.java @@ -0,0 +1,587 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql + */ +package queries; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         {@literal @}Constraint(key={a}, severity="error", message="error")
+ *         pattern oppositeDifferentClass(a:EReference) {
+ *         	EReference.eOpposite(a,b);
+ *         	EReference.eContainingClass(a,aContaining);
+ *         	EReference.eType(b,bTarget);
+ *         	aContaining != bTarget;
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class OppositeDifferentClass extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the queries.oppositeDifferentClass pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EReference fA; + + private static List parameterNames = makeImmutableList("a"); + + private Match(final EReference pA) { + this.fA = pA; + } + + @Override + public Object get(final String parameterName) { + switch(parameterName) { + case "a": return this.fA; + default: return null; + } + } + + @Override + public Object get(final int index) { + switch(index) { + case 0: return this.fA; + default: return null; + } + } + + public EReference getA() { + return this.fA; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EReference) newValue; + return true; + } + return false; + } + + public void setA(final EReference pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + @Override + public String patternName() { + return "queries.oppositeDifferentClass"; + } + + @Override + public List parameterNames() { + return OppositeDifferentClass.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA}; + } + + @Override + public OppositeDifferentClass.Match toImmutable() { + return isMutable() ? newMatch(fA) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof OppositeDifferentClass.Match)) { + OppositeDifferentClass.Match other = (OppositeDifferentClass.Match) obj; + return Objects.equals(fA, other.fA); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public OppositeDifferentClass specification() { + return OppositeDifferentClass.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static OppositeDifferentClass.Match newEmptyMatch() { + return new Mutable(null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static OppositeDifferentClass.Match newMutableMatch(final EReference pA) { + return new Mutable(pA); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the (partial) match object. + * + */ + public static OppositeDifferentClass.Match newMatch(final EReference pA) { + return new Immutable(pA); + } + + private static final class Mutable extends OppositeDifferentClass.Match { + Mutable(final EReference pA) { + super(pA); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends OppositeDifferentClass.Match { + Immutable(final EReference pA) { + super(pA); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the queries.oppositeDifferentClass pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * {@literal @}Constraint(key={a}, severity="error", message="error")
+   * pattern oppositeDifferentClass(a:EReference) {
+   * 	EReference.eOpposite(a,b);
+   * 	EReference.eContainingClass(a,aContaining);
+   * 	EReference.eType(b,bTarget);
+   * 	aContaining != bTarget;
+   * }
+   * 
+ * + * @see Match + * @see OppositeDifferentClass + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static OppositeDifferentClass.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static OppositeDifferentClass.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(OppositeDifferentClass.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EReference pA) { + return rawStreamAllMatches(new Object[]{pA}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EReference pA) { + return rawStreamAllMatches(new Object[]{pA}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EReference pA) { + return rawGetOneArbitraryMatch(new Object[]{pA}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EReference pA) { + return rawHasMatch(new Object[]{pA}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EReference pA) { + return rawCountMatches(new Object[]{pA}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EReference pA, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the (partial) match object. + * + */ + public OppositeDifferentClass.Match newMatch(final EReference pA) { + return OppositeDifferentClass.Match.newMatch(pA); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + @Override + protected OppositeDifferentClass.Match tupleToMatch(final Tuple t) { + try { + return OppositeDifferentClass.Match.newMatch((EReference) t.get(POSITION_A)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected OppositeDifferentClass.Match arrayToMatch(final Object[] match) { + try { + return OppositeDifferentClass.Match.newMatch((EReference) match[POSITION_A]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected OppositeDifferentClass.Match arrayToMatchMutable(final Object[] match) { + try { + return OppositeDifferentClass.Match.newMutableMatch((EReference) match[POSITION_A]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return OppositeDifferentClass.instance(); + } + } + + private OppositeDifferentClass() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static OppositeDifferentClass instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected OppositeDifferentClass.Matcher instantiate(final ViatraQueryEngine engine) { + return OppositeDifferentClass.Matcher.on(engine); + } + + @Override + public OppositeDifferentClass.Matcher instantiate() { + return OppositeDifferentClass.Matcher.create(); + } + + @Override + public OppositeDifferentClass.Match newEmptyMatch() { + return OppositeDifferentClass.Match.newEmptyMatch(); + } + + @Override + public OppositeDifferentClass.Match newMatch(final Object... parameters) { + return OppositeDifferentClass.Match.newMatch((org.eclipse.emf.ecore.EReference) parameters[0]); + } + + /** + * Inner class allowing the singleton instance of {@link OppositeDifferentClass} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link OppositeDifferentClass#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final OppositeDifferentClass INSTANCE = new OppositeDifferentClass(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final OppositeDifferentClass.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "queries.oppositeDifferentClass"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + PVariable var_b = body.getOrCreateVariableByName("b"); + PVariable var_aContaining = body.getOrCreateVariableByName("aContaining"); + PVariable var_bTarget = body.getOrCreateVariableByName("bTarget"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a) + )); + // EReference.eOpposite(a,b) + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference", "eOpposite"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + new Equality(body, var__virtual_0_, var_b); + // EReference.eContainingClass(a,aContaining) + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EStructuralFeature", "eContainingClass"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + new Equality(body, var__virtual_1_, var_aContaining); + // EReference.eType(b,bTarget) + new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_b, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "ETypedElement", "eType"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClassifier"))); + new Equality(body, var__virtual_2_, var_bTarget); + // aContaining != bTarget + new Inequality(body, var_aContaining, var_bTarget); + bodies.add(body); + } + { + PAnnotation annotation = new PAnnotation("Constraint"); + annotation.addAttribute("key", Arrays.asList(new Object[] { + new ParameterReference("a") + })); + annotation.addAttribute("severity", "error"); + annotation.addAttribute("message", "error"); + addAnnotation(annotation); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/SuperTypes.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/SuperTypes.java new file mode 100644 index 00000000..4bf7a455 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src-gen/queries/SuperTypes.java @@ -0,0 +1,703 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql + */ +package queries; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         pattern superTypes(c1:EClass, c2:EClass){
+ *         	EClass.eSuperTypes(c1,c2);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class SuperTypes extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the queries.superTypes pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EClass fC1; + + private EClass fC2; + + private static List parameterNames = makeImmutableList("c1", "c2"); + + private Match(final EClass pC1, final EClass pC2) { + this.fC1 = pC1; + this.fC2 = pC2; + } + + @Override + public Object get(final String parameterName) { + switch(parameterName) { + case "c1": return this.fC1; + case "c2": return this.fC2; + default: return null; + } + } + + @Override + public Object get(final int index) { + switch(index) { + case 0: return this.fC1; + case 1: return this.fC2; + default: return null; + } + } + + public EClass getC1() { + return this.fC1; + } + + public EClass getC2() { + return this.fC2; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("c1".equals(parameterName) ) { + this.fC1 = (EClass) newValue; + return true; + } + if ("c2".equals(parameterName) ) { + this.fC2 = (EClass) newValue; + return true; + } + return false; + } + + public void setC1(final EClass pC1) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fC1 = pC1; + } + + public void setC2(final EClass pC2) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fC2 = pC2; + } + + @Override + public String patternName() { + return "queries.superTypes"; + } + + @Override + public List parameterNames() { + return SuperTypes.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fC1, fC2}; + } + + @Override + public SuperTypes.Match toImmutable() { + return isMutable() ? newMatch(fC1, fC2) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"c1\"=" + prettyPrintValue(fC1) + ", "); + result.append("\"c2\"=" + prettyPrintValue(fC2)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fC1, fC2); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof SuperTypes.Match)) { + SuperTypes.Match other = (SuperTypes.Match) obj; + return Objects.equals(fC1, other.fC1) && Objects.equals(fC2, other.fC2); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public SuperTypes specification() { + return SuperTypes.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static SuperTypes.Match newEmptyMatch() { + return new Mutable(null, null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pC1 the fixed value of pattern parameter c1, or null if not bound. + * @param pC2 the fixed value of pattern parameter c2, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static SuperTypes.Match newMutableMatch(final EClass pC1, final EClass pC2) { + return new Mutable(pC1, pC2); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pC1 the fixed value of pattern parameter c1, or null if not bound. + * @param pC2 the fixed value of pattern parameter c2, or null if not bound. + * @return the (partial) match object. + * + */ + public static SuperTypes.Match newMatch(final EClass pC1, final EClass pC2) { + return new Immutable(pC1, pC2); + } + + private static final class Mutable extends SuperTypes.Match { + Mutable(final EClass pC1, final EClass pC2) { + super(pC1, pC2); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends SuperTypes.Match { + Immutable(final EClass pC1, final EClass pC2) { + super(pC1, pC2); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the queries.superTypes pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * pattern superTypes(c1:EClass, c2:EClass){
+   * 	EClass.eSuperTypes(c1,c2);
+   * }
+   * 
+ * + * @see Match + * @see SuperTypes + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static SuperTypes.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static SuperTypes.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_C1 = 0; + + private static final int POSITION_C2 = 1; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(SuperTypes.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pC1 the fixed value of pattern parameter c1, or null if not bound. + * @param pC2 the fixed value of pattern parameter c2, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EClass pC1, final EClass pC2) { + return rawStreamAllMatches(new Object[]{pC1, pC2}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pC1 the fixed value of pattern parameter c1, or null if not bound. + * @param pC2 the fixed value of pattern parameter c2, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EClass pC1, final EClass pC2) { + return rawStreamAllMatches(new Object[]{pC1, pC2}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pC1 the fixed value of pattern parameter c1, or null if not bound. + * @param pC2 the fixed value of pattern parameter c2, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EClass pC1, final EClass pC2) { + return rawGetOneArbitraryMatch(new Object[]{pC1, pC2}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pC1 the fixed value of pattern parameter c1, or null if not bound. + * @param pC2 the fixed value of pattern parameter c2, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EClass pC1, final EClass pC2) { + return rawHasMatch(new Object[]{pC1, pC2}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pC1 the fixed value of pattern parameter c1, or null if not bound. + * @param pC2 the fixed value of pattern parameter c2, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EClass pC1, final EClass pC2) { + return rawCountMatches(new Object[]{pC1, pC2}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pC1 the fixed value of pattern parameter c1, or null if not bound. + * @param pC2 the fixed value of pattern parameter c2, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EClass pC1, final EClass pC2, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pC1, pC2}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pC1 the fixed value of pattern parameter c1, or null if not bound. + * @param pC2 the fixed value of pattern parameter c2, or null if not bound. + * @return the (partial) match object. + * + */ + public SuperTypes.Match newMatch(final EClass pC1, final EClass pC2) { + return SuperTypes.Match.newMatch(pC1, pC2); + } + + /** + * Retrieve the set of values that occur in matches for c1. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfc1(final Object[] parameters) { + return rawStreamAllValues(POSITION_C1, parameters).map(EClass.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for c1. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfc1() { + return rawStreamAllValuesOfc1(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for c1. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfc1() { + return rawStreamAllValuesOfc1(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for c1. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfc1(final SuperTypes.Match partialMatch) { + return rawStreamAllValuesOfc1(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for c1. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfc1(final EClass pC2) { + return rawStreamAllValuesOfc1(new Object[]{null, pC2}); + } + + /** + * Retrieve the set of values that occur in matches for c1. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfc1(final SuperTypes.Match partialMatch) { + return rawStreamAllValuesOfc1(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for c1. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfc1(final EClass pC2) { + return rawStreamAllValuesOfc1(new Object[]{null, pC2}).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for c2. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfc2(final Object[] parameters) { + return rawStreamAllValues(POSITION_C2, parameters).map(EClass.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for c2. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfc2() { + return rawStreamAllValuesOfc2(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for c2. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfc2() { + return rawStreamAllValuesOfc2(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for c2. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfc2(final SuperTypes.Match partialMatch) { + return rawStreamAllValuesOfc2(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for c2. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfc2(final EClass pC1) { + return rawStreamAllValuesOfc2(new Object[]{pC1, null}); + } + + /** + * Retrieve the set of values that occur in matches for c2. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfc2(final SuperTypes.Match partialMatch) { + return rawStreamAllValuesOfc2(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for c2. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfc2(final EClass pC1) { + return rawStreamAllValuesOfc2(new Object[]{pC1, null}).collect(Collectors.toSet()); + } + + @Override + protected SuperTypes.Match tupleToMatch(final Tuple t) { + try { + return SuperTypes.Match.newMatch((EClass) t.get(POSITION_C1), (EClass) t.get(POSITION_C2)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected SuperTypes.Match arrayToMatch(final Object[] match) { + try { + return SuperTypes.Match.newMatch((EClass) match[POSITION_C1], (EClass) match[POSITION_C2]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected SuperTypes.Match arrayToMatchMutable(final Object[] match) { + try { + return SuperTypes.Match.newMutableMatch((EClass) match[POSITION_C1], (EClass) match[POSITION_C2]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return SuperTypes.instance(); + } + } + + private SuperTypes() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static SuperTypes instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected SuperTypes.Matcher instantiate(final ViatraQueryEngine engine) { + return SuperTypes.Matcher.on(engine); + } + + @Override + public SuperTypes.Matcher instantiate() { + return SuperTypes.Matcher.create(); + } + + @Override + public SuperTypes.Match newEmptyMatch() { + return SuperTypes.Match.newEmptyMatch(); + } + + @Override + public SuperTypes.Match newMatch(final Object... parameters) { + return SuperTypes.Match.newMatch((org.eclipse.emf.ecore.EClass) parameters[0], (org.eclipse.emf.ecore.EClass) parameters[1]); + } + + /** + * Inner class allowing the singleton instance of {@link SuperTypes} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link SuperTypes#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final SuperTypes INSTANCE = new SuperTypes(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final SuperTypes.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_c1 = new PParameter("c1", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); + + private final PParameter parameter_c2 = new PParameter("c2", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_c1, parameter_c2); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "queries.superTypes"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("c1","c2"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_c1 = body.getOrCreateVariableByName("c1"); + PVariable var_c2 = body.getOrCreateVariableByName("c2"); + new TypeConstraint(body, Tuples.flatTupleOf(var_c1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + new TypeConstraint(body, Tuples.flatTupleOf(var_c2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_c1, parameter_c1), + new ExportedParameter(body, var_c2, parameter_c2) + )); + // EClass.eSuperTypes(c1,c2) + new TypeConstraint(body, Tuples.flatTupleOf(var_c1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_c1, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass", "eSuperTypes"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + new Equality(body, var__virtual_0_, var_c2); + bodies.add(body); + } + return bodies; + } + } +} 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 @@ +package ca.mcgill.ecse.socialnetwork.plugin + +import epackage "http://ecse.mcgill.ca/socialnetwork" + +//@Constraint(message="terminatorAndInformation", severity="error", key={T}) +//pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { +// FunctionalOutput.outgoingLinks(Out,I); +// FunctionalOutput.terminator(Out,T); +//} or { +// InformationLink.to(I,In); +// FunctionalInput.terminator(In,T); +//} + +@Constraint(message="singleFriendship", severity="error", key={p1}) +pattern singleFriendship(p1: Person) { + find friendship(p1, p); + neg find friendship(p, p1); +} + +//@Constraint(message="cycle", severity="error", key={p}) +//pattern cycleInParenthood(p: Person) { +// find isAncestor(p, p); +//} + +@Constraint(message="noFriend", severity="error", key={p}) +pattern noFriend(p: Person){ + neg find friendship(p, _); +} + +//@Constraint(message="brothhoodParent", severity="error", key={p1,p2}) +//pattern brothhoodParent(p1: Person, p2: Person){ +// Person.parents(p1, parent1); +// Person.parents(p2, parent2); +// parent1 == parent2; +// find isAncestor(p1, p2); +//} +@Constraint(message="selfFriend", severity="error", key={p}) +pattern selfFriend(p: Person){ + Person.friends(p,p); +} + +pattern friendship(p1: Person, p2: Person){ + Person.friends(p1,p2); +} + +//pattern isAncestor(person : Person, ancestor : Person){ +// Person.parents(person, ancestor); +//} or { +// Person.parents(person, parent); +// find isAncestor(parent, ancestor); +//} + + + 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..e4e5b61f --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/src/ca/mcgill/ecse/socialnetwork/runner/Main.java @@ -0,0 +1,203 @@ +package ca.mcgill.ecse.socialnetwork.runner; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Map; +import java.util.Scanner; + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app.Domain; +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance.KSDistance; +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.EMFGraph; +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.CsvFileWriter; +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.GraphReader; +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.RepMetricsReader; +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup; +import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor; +import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.YakindummPackage; +import socialnetwork.Person; + +public class Main { + + private static String runWithPath(String path) { + String message = StandaloneScriptExecutor.executeScript(path); + return message; + } + + private static String configFolder = "yakinduum/config22/"; + private static String configFileName = configFolder + "info_old_metric.csv"; + private static String aggregateViolationMeasureFileName = configFolder + "aggregateInfo.csv"; + private static String fileReadFolder = "output/Ecore_100/"; + + public static void main(String args[]) { + String ecoreFile = args[0]; + System.out.println("Generation Started"); + + System.out.println(System.getProperty("java.library.path")); + + long begin = System.currentTimeMillis(); + String message = runWithPath(ecoreFile); + long elapsed = System.currentTimeMillis() - begin; + + if(message != null) { + System.out.println(message); + return; + } +// ArrayList> output = new ArrayList>(); +// String time = formatTime(elapsed); +// ArrayList infoOutput = new ArrayList(); +// infoOutput.add(time); +// output.add(infoOutput); +// System.out.println(time); +// CsvFileWriter.write(output, configFileName); +// +// +// output = new ArrayList>(); +// output.add(prepareInfo()); +// CsvFileWriter.append(output, configFileName); +// +// for(int i = 0; i < 50; i++) { +// generateModel(i+1); +// } +// aggregateViolationMeasure(50); + System.out.println("Finished"); + } + +// public static void generateModel(int run) { +// String filename = run+"_1.xmi"; +// //prepare initial info +// ArrayList> output = new ArrayList>(); +// ArrayList infoOutput = new ArrayList(); +// infoOutput.add(run+ ""); +// infoOutput.addAll(calculateMetric(run)); +// +// YakinduumModel model = new YakinduumModel(fileReadFolder +"run" +run + "/" + filename); +// int violationCount = ViolationCheck.calculateViolationCounts(model.yakinduum); +// infoOutput.add(violationCount + ""); +// +// +// +// //save model to another directory +// model.save(configFolder + run + ".xmi"); +// output.add(infoOutput); +// CsvFileWriter.append(output, configFileName); +// } +// +// public static void singleModelViolationMeasure(int run) { +// String filename = run+"_1.xmi"; +// //prepare initial info +// ArrayList> output = new ArrayList>(); +// ArrayList infoOutput = new ArrayList(); +// infoOutput.add(run+ ""); +// +// YakinduumModel model = new YakinduumModel(fileReadFolder+"/run"+run+"/"+ filename); +// +// //parse map of violation counts to two list and add them to the result list +// Map map = ViolationCheck.violationMaps(model.yakinduum); +// ArrayList counts = new ArrayList(); +// ArrayList violationNames = new ArrayList(map.keySet()); +// for(int i = 0; i < violationNames.size(); i++) { +// String name = violationNames.get(i); +// int total = map.get(name); +// counts.add(total + ""); +// } +// output.add(infoOutput); +// output.add(violationNames); +// output.add(counts); +// +// CsvFileWriter.append(output, configFileName); +// } +// +// public static void aggregateViolationMeasure(int size) { +// ArrayList> output = new ArrayList>(); +// ArrayList counts = new ArrayList(); +// ArrayList violationNames = null; +// for(int run = 1; run < size+1; run++) { +// String filename = run+"_1.xmi"; +// YakinduumModel model = new YakinduumModel(fileReadFolder+"/run"+run+"/"+ filename); +// +// Map map = ViolationCheck.violationMaps(model.yakinduum); +// if(run == 1) { +// violationNames = new ArrayList(map.keySet()); +// for(int i = 0; i < violationNames.size(); i++) { +// String name = violationNames.get(i); +// int total = map.get(name); +// counts.add(total + ""); +// } +// }else { +// for(int i = 0; i < violationNames.size(); i++) { +// int count = Integer.parseInt(counts.get(i)); +// String name = violationNames.get(i); +// int total = count + map.get(name); +// counts.set(i, total + ""); +// } +// } +// } +// +// for(int i = 0; i < counts.size(); i++) { +// double count = Integer.parseInt(counts.get(i)) / (double) size; +// counts.set(i, count + ""); +// } +// +// output.add(violationNames); +// output.add(counts); +// CsvFileWriter.write(output, aggregateViolationMeasureFileName); +// } +// + public static ArrayList calculateMetric(int run) { + //read model and metric + ArrayList output = new ArrayList(); + GraphReader reader = new GraphReader(YakindummPackage.eINSTANCE, ".xmi"); + EMFGraph graph = reader.readModel(fileReadFolder+"/run"+run, run + "_1.xmi"); + MetricSampleGroup metrics = RepMetricsReader.read(Domain.Yakindumm); + //KS distance + KSDistance ks = new KSDistance(metrics); + + //calculate and put metric data to output array + MetricSampleGroup samples = graph.evaluateAllMetricsToSamples(); + output.add(graph.getStatistic().getAllNodes().size() + ""); + output.add(ks.outDegreeDistance(samples.outDegreeSamples) + ""); + output.add(ks.naDistance(samples.naSamples)+ ""); + output.add(ks.mpcDistance(samples.mpcSamples) + ""); + output.add(ks.typedOutDegreeDistance(samples.typedOutDegreeSamples) + ""); + return output; + } + + public static ArrayList prepareInfo() { + ArrayList info = new ArrayList(); + info.add("ID"); + info.add("# of Nodes"); + info.add("Out Degree"); + info.add("Node Activity"); + info.add("MPC"); + info.add("Typed Out Degree"); + info.add("Violations"); + return info; + } + + public static String formatTime(long time) { + long mili = time % 1000; + long second = (time / 1000) % 60; + long minute = (time / (1000 * 60)); + return String.format("%d : %d.%d", minute, second, mili); + } + + public static void statistics() { + String uri = "output/1.xmi"; + SocialNetworkModel socialNetwork = new SocialNetworkModel(uri); + System.out.println(socialNetwork.getPersons().size()); + + File file = new File("model/statistics/output.txt"); + try { + @SuppressWarnings("resource") + PrintStream out = new PrintStream(file); + for(Person p : socialNetwork.getPersons()) { + out.println(p.getFriends().size()); + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + System.out.println("Output Finished"); + } +} 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 @@ +package ca.mcgill.ecse.socialnetwork.runner; +import java.io.IOException; +import java.util.Collections; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; + +public class Persisitence { + private String uri; + + public Persisitence (String suffix, String uri){ + //prepare to save + Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; + Map m = reg.getExtensionToFactoryMap(); + m.put(suffix, new XMIResourceFactoryImpl()); + this.uri = uri; + } + + + /** + * Save the model + * @return whether the model has saved successfully + */ + public boolean save(G model) { + //create resource + ResourceSet resSet = new ResourceSetImpl(); + Resource resource = resSet.createResource(URI.createURI(uri)); + resource.getContents().add(model); + try { + resource.save(Collections.EMPTY_MAP); + return true; + }catch(IOException e) { + e.printStackTrace(); + return false; + } + } + + /** + * load the model from persistent + * @return: the model loaded + */ + @SuppressWarnings("unchecked") + public G load() { + G model = null; +// try { + ResourceSet resSet = new ResourceSetImpl(); + Resource resource = resSet.getResource(URI.createURI(uri), true); + model = (G) resource.getContents().get(0); +// }catch (org.eclipse.emf.common.util.WrappedException e) { +// // if the file cannot be found then return null +// if(e.getCause().getClass() == java.io.FileNotFoundException.class) { +// return null; +// } +// } + + return model; + } +} 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 @@ +package ca.mcgill.ecse.socialnetwork.runner; + +import org.junit.Test; + +import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor; + +public class RunnerTests { + private static String runWithPath(String path) { + String message = StandaloneScriptExecutor.executeScript(path); + return message; + } + + @Test + public void generateModel() { + String message = runWithPath("SocialNetworkGeneration.vsconfig"); + System.out.println(message); + } +} 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 @@ +package ca.mcgill.ecse.socialnetwork.runner; + +import org.eclipse.emf.common.util.EList; + +import socialnetwork.Person; +import socialnetwork.SocialNetwork; +import socialnetwork.SocialnetworkFactory; +import socialnetwork.SocialnetworkPackage; +import socialnetwork.impl.SocialnetworkFactoryImpl; + + + +public class SocialNetworkModel { + private final static String SUFFIX = "xmi"; + + private static boolean isInit = false; + + public static void init() { + SocialnetworkFactory.eINSTANCE.eClass(); + SocialnetworkPackage.eINSTANCE.eClass(); + SocialnetworkFactoryImpl.init(); + } + + // container for the social network model + public SocialNetwork socialNetwork; + + // factory for social network model + SocialnetworkFactory factory; + + // persistent + Persisitence persistence; + + + public SocialNetworkModel(String uri){ + if(!isInit) { + init(); + } + + //create persistence + persistence = new Persisitence(SUFFIX, uri); + factory = SocialnetworkFactory.eINSTANCE; + // try load the model + this.socialNetwork = persistence.load(); + if(this.socialNetwork == null) { + this.socialNetwork = factory.createSocialNetwork(); + } + } + + public Person createPerson() { + Person p = factory.createPerson(); + socialNetwork.getPersons().add(p); + return p; + } + + public EList getPersons(){ + return socialNetwork.getPersons(); + } + + public boolean save() { + return persistence.save(socialNetwork); + } +} 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 @@ +package ca.mcgill.ecse.socialnetwork.runner; + +import javax.annotation.Resource; + +import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.Statechart; +import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.YakindummFactory; +import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.YakindummPackage; +import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl.YakindummFactoryImpl; +import socialnetwork.SocialNetwork; +import socialnetwork.SocialnetworkFactory; + +public class YakinduumModel { + private final static String SUFFIX = "xmi"; + + private static boolean isInit = false; + + private String uri; + + public static void init() { + YakindummFactory.eINSTANCE.eClass(); + YakindummPackage.eINSTANCE.eClass(); + YakindummFactoryImpl.init(); + } + + // container for the social network model + public Statechart yakinduum; + + + // persistent + Persisitence persistence; + + + public YakinduumModel(String uri){ + if(!isInit) { + init(); + } + this.uri = uri; + //create persistence + persistence = new Persisitence(SUFFIX, uri); + // try load the model + this.yakinduum = persistence.load(); + } + + public boolean save(String uri) { + if(this.uri.equals(uri)) { + return persistence.save(yakinduum); + }else { + persistence = new Persisitence(SUFFIX, uri); + return persistence.save(yakinduum); + } + } +} diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/100.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/100.csv new file mode 100644 index 00000000..fd1af09c --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/100.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime,_Solution0FoundAt +5,1,InsuficientResourcesResultImpl,26,1815,305292,1000,16140,15,12210,260570,0,0, +5,2,InsuficientResourcesResultImpl,26,1237,301846,700,14659,0,12249,259139,0,0, +5,3,InsuficientResourcesResultImpl,26,1218,301687,600,15765,0,12876,256432,0,0, +5,4,InsuficientResourcesResultImpl,26,1294,302248,800,18015,0,11131,255608,0,0, +5,5,InsuficientResourcesResultImpl,26,1290,300894,900,14893,0,11118,259377,0,0, +5,6,InsuficientResourcesResultImpl,26,1184,302351,900,16463,0,11499,258946,0,0, +5,7,ModelResultImpl,26,1180,289935,35396400,17823,0,14375,240465,0,4,287519 +5,8,InsuficientResourcesResultImpl,26,1298,304757,700,12762,0,10686,266461,0,0, +5,9,ModelResultImpl,26,1166,287620,35860800,17055,0,15050,237850,0,1,285304 +5,10,ModelResultImpl,26,1185,168322,32789700,15059,0,9955,132727,0,0,166044 +5,11,InsuficientResourcesResultImpl,26,1176,302293,900,12773,0,10338,264930,0,0, +5,12,InsuficientResourcesResultImpl,26,1200,300206,600,14139,0,11334,260462,0,0, +5,13,InsuficientResourcesResultImpl,26,1199,305554,500,12939,0,11144,266919,0,0, +5,14,InsuficientResourcesResultImpl,26,1193,300864,700,18895,0,14266,250111,0,0, +5,15,InsuficientResourcesResultImpl,26,1197,303894,700,14501,0,12313,262474,0,0, +5,16,InsuficientResourcesResultImpl,26,1171,303003,700,13178,0,11827,263585,0,0, +5,17,InsuficientResourcesResultImpl,26,1169,305501,600,13479,0,11788,265540,0,0, +5,18,InsuficientResourcesResultImpl,26,1175,301967,700,13531,0,11415,262420,0,0, +5,19,InsuficientResourcesResultImpl,26,1274,300241,800,13254,0,11607,260895,0,0, +5,20,ModelResultImpl,26,1166,269530,42362900,17007,0,13440,223316,0,1,267245 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/30.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/30.csv new file mode 100644 index 00000000..0022e984 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/30.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +2,1,ModelResultImpl,19,1721,35221,15771300,32311,7042,34,1895,16580,0,1 +2,2,ModelResultImpl,19,1610,35749,11651300,32635,6745,1,1736,18895,0,1 +2,3,ModelResultImpl,19,1640,27258,16117300,24303,6429,0,1323,12286,0,1 +2,4,ModelResultImpl,19,1634,35933,20450700,33223,6381,0,1605,20611,0,2 +2,5,ModelResultImpl,19,1612,23612,11651100,19721,6887,0,1099,8730,0,0 +2,6,ModelResultImpl,19,1319,22727,9964000,20364,4974,0,1147,11737,0,0 +2,7,ModelResultImpl,19,1278,22340,12342400,19967,4711,0,1078,11660,0,0 +2,8,ModelResultImpl,19,1292,20551,10731500,18317,4260,0,1007,11070,0,0 +2,9,ModelResultImpl,19,1378,18306,12922900,15874,4176,0,928,8796,0,1 +2,10,ModelResultImpl,19,1330,25726,10084700,23254,6531,0,1345,10615,0,0 +2,11,ModelResultImpl,19,1229,33084,12002300,30734,5309,0,1584,19392,0,0 +2,12,ModelResultImpl,19,1240,24555,9818800,22179,5967,1,1405,10083,0,0 +2,13,ModelResultImpl,19,1264,28275,11451700,25939,5692,0,1395,14547,0,0 +2,14,ModelResultImpl,19,1276,36197,10007300,33900,5461,0,1659,22219,0,0 +2,15,ModelResultImpl,19,1230,30436,9231400,28100,5354,0,1488,16718,0,0 +2,16,ModelResultImpl,19,1217,22614,8885000,20287,6795,0,1371,7299,0,0 +2,17,ModelResultImpl,19,1262,29600,12922400,27253,5298,0,1528,15895,0,0 +2,18,ModelResultImpl,19,1243,28214,10765500,25879,5412,0,1292,15319,0,0 +2,19,ModelResultImpl,19,1299,20845,11064400,18336,5327,0,1048,8903,0,0 +2,20,ModelResultImpl,19,1280,26352,10670800,23901,6709,0,1454,11410,0,1 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/50.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/50.csv new file mode 100644 index 00000000..1ea0ccaf --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/50.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +3,1,ModelResultImpl,7,1300,78258,16468500,75732,13071,7,4896,46003,0,2 +3,2,ModelResultImpl,7,1255,72729,15062600,70201,10011,0,4148,48760,0,0 +3,3,ModelResultImpl,7,1284,85751,18952400,83381,10015,0,4783,59452,0,0 +3,4,ModelResultImpl,7,1312,80702,18255000,78055,9873,0,3766,56886,0,1 +3,5,ModelResultImpl,7,2192,111362,20902300,108184,12705,0,5062,79232,0,0 +3,6,ModelResultImpl,7,1275,88255,20727400,85645,9667,0,3925,64755,0,0 +3,7,ModelResultImpl,7,1228,95312,23184200,92818,9763,0,4466,69648,0,1 +3,8,ModelResultImpl,7,1421,102160,16746000,99564,13923,0,5149,68705,0,1 +3,9,ModelResultImpl,7,1542,74130,15142300,71709,10116,0,4021,50574,0,0 +3,10,ModelResultImpl,7,1370,106586,18544500,103524,11809,0,4614,78092,0,1 +3,11,ModelResultImpl,7,1977,81554,14689300,78988,9059,0,4109,58293,0,1 +3,12,ModelResultImpl,7,1282,80592,17114200,77924,10654,0,4120,55221,0,0 +3,13,ModelResultImpl,7,1470,50749,14006900,47249,7112,0,2464,34560,0,0 +3,14,ModelResultImpl,7,1189,96780,16081900,94561,8346,0,4262,74850,0,0 +3,15,ModelResultImpl,7,1187,104866,17029000,102503,8484,0,4673,81148,0,0 +3,16,ModelResultImpl,7,1192,83407,19208900,81122,8548,0,4154,61175,0,1 +3,17,ModelResultImpl,7,1291,84064,18326300,81220,10675,0,4308,57616,0,0 +3,18,ModelResultImpl,7,1924,92524,20324400,89145,9764,0,4238,66918,0,1 +3,19,ModelResultImpl,7,1284,85575,14840500,82932,10403,0,4104,60536,0,0 +3,20,ModelResultImpl,7,1239,78254,21057200,75918,9173,0,3958,55242,0,0 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/80.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/80.csv new file mode 100644 index 00000000..034a2048 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/80.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +4,1,ModelResultImpl,10,1339,187225,43638100,184585,14565,8,8893,149868,0,0 +4,2,ModelResultImpl,10,1336,258364,34407600,255655,14281,1,9835,217586,0,0 +4,3,InsuficientResourcesResultImpl,10,1321,302464,3900,,14999,0,10218,258608,0,0 +4,4,ModelResultImpl,10,1569,272300,28546600,269342,14187,0,9965,231046,0,0 +4,5,ModelResultImpl,10,1315,244950,39639300,242286,14765,0,10575,202813,0,0 +4,6,ModelResultImpl,10,1223,185629,34348900,183286,14074,0,9227,147910,0,0 +4,7,ModelResultImpl,10,1271,243243,28619100,240866,16030,0,10594,199605,0,1 +4,8,ModelResultImpl,10,1229,247712,31642900,244834,14393,0,9543,207278,0,0 +4,9,ModelResultImpl,10,1284,209619,24479700,207199,18848,0,10225,164689,0,0 +4,10,ModelResultImpl,10,1240,252740,36766100,250104,15959,0,10730,208822,0,1 +4,11,ModelResultImpl,10,1315,192678,27966300,190097,15350,0,9230,152579,0,1 +4,12,ModelResultImpl,10,1767,199644,24666200,195878,16171,0,9709,158015,0,1 +4,13,ModelResultImpl,10,1411,209397,29226100,206486,17127,0,10334,164735,0,0 +4,14,InsuficientResourcesResultImpl,10,1292,300133,800,,13558,0,10569,258303,0,0 +4,15,ModelResultImpl,10,1188,277607,29611300,275175,13898,0,11204,234760,0,0 +4,16,ModelResultImpl,10,1383,257815,41453700,255328,13012,0,10666,216491,0,1 +4,17,ModelResultImpl,10,1335,217424,30586300,214754,15737,0,9889,176416,0,0 +4,18,ModelResultImpl,10,1317,214706,28448000,211898,15332,0,9390,175241,0,1 +4,19,ModelResultImpl,10,1429,235982,26350500,233087,15836,0,10258,192499,0,1 +4,20,InsuficientResourcesResultImpl,10,1150,302957,1100,,16272,0,12639,253942,0,0 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/warmup.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/warmup.csv new file mode 100644 index 00000000..126b6dca --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Ecore/warmup.csv @@ -0,0 +1,3 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,Solution1FoundAt,ExplorationInitializationTime,TransformationExecutionTime,TypeAnalysisTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime,ActivationSelectionTime,NumericalSolverSumTime,NumericalSolverProblemFormingTime,NumericalSolverSolvingTime,NumericalSolverInterpretingSolution,NumericalSolverCachingTime,NumericalSolverCallNumber,NumericalSolverCachedAnswerNumber +1,1,ModelResultImpl,1224,3526,17696,152,12788,5289,2215,356,1661,0,8,1,0,0,0,0,0,0,0 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/30.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/30.csv new file mode 100644 index 00000000..d1ec723b --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/30.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +2,1,ModelResultImpl,5,753,17109,13399400,16654,1789,9,696,11984,0,0 +2,2,ModelResultImpl,5,628,17801,12301800,17369,1678,0,715,12727,0,0 +2,3,ModelResultImpl,5,610,15430,13989100,14970,1285,0,586,11377,0,0 +2,4,ModelResultImpl,5,803,14781,11475500,14220,1483,0,640,10196,0,0 +2,5,ModelResultImpl,5,581,22641,12669300,22193,1558,0,707,17778,0,0 +2,6,ModelResultImpl,5,611,22649,11553300,22203,1508,0,660,17965,0,0 +2,7,ModelResultImpl,5,548,12438,10128400,12033,1584,0,616,7995,0,0 +2,8,ModelResultImpl,5,655,17624,10593200,17198,1404,0,619,13273,0,0 +2,9,ModelResultImpl,5,596,16946,10102500,16528,1717,0,705,11847,0,0 +2,10,ModelResultImpl,5,537,17896,10038000,17507,1414,0,626,13625,0,0 +2,11,ModelResultImpl,5,535,13771,11741600,13353,1411,0,613,9547,0,0 +2,12,ModelResultImpl,5,531,16728,11768600,16257,1448,0,635,12199,0,0 +2,13,ModelResultImpl,5,549,14647,11546900,14254,1201,0,573,10920,0,0 +2,14,ModelResultImpl,5,552,15942,10918300,15492,1502,0,610,11459,0,0 +2,15,ModelResultImpl,5,563,15196,12483700,14773,1389,0,574,11130,0,0 +2,16,ModelResultImpl,5,566,10267,10445100,9864,1364,0,523,6468,0,0 +2,17,ModelResultImpl,5,600,15595,8099800,15147,1341,0,624,11381,0,0 +2,18,ModelResultImpl,5,561,11172,9144100,10776,1167,0,487,7740,0,0 +2,19,ModelResultImpl,5,548,14818,9372000,14441,1565,0,658,10261,0,0 +2,20,ModelResultImpl,5,559,17497,9881500,17059,1532,0,651,12811,0,0 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/50.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/50.csv new file mode 100644 index 00000000..7ed016e0 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/50.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +4,1,ModelResultImpl,11,730,72467,34401400,71866,4026,10,1998,59824,0,0 +4,2,ModelResultImpl,11,761,67853,11838400,67382,3819,0,1957,55882,0,0 +4,3,ModelResultImpl,11,734,45541,10393700,45056,3529,0,1779,34849,0,0 +4,4,ModelResultImpl,11,619,55697,17081600,55167,3617,0,1898,44356,0,0 +4,5,ModelResultImpl,11,726,64846,29758900,64208,3905,0,2030,52466,0,0 +4,6,ModelResultImpl,11,712,65893,13089200,65423,3972,0,2029,53618,0,0 +4,7,ModelResultImpl,11,742,50982,16405400,50469,3638,0,1857,39804,0,0 +4,8,ModelResultImpl,11,590,50309,15985400,49731,3572,0,1877,39187,0,0 +4,9,ModelResultImpl,11,761,65533,23499900,65008,3890,0,2000,53225,0,0 +4,10,ModelResultImpl,11,688,44853,23629200,44348,3255,0,1695,34758,0,0 +4,11,ModelResultImpl,11,626,59167,38070600,58611,3942,0,1864,47290,0,0 +4,12,ModelResultImpl,11,642,66860,18966400,66364,3732,0,1987,54960,0,0 +4,13,ModelResultImpl,11,622,65317,12053900,64842,3176,0,1633,55177,0,1 +4,14,ModelResultImpl,11,687,45481,79001300,44944,3485,0,1661,35036,0,0 +4,15,ModelResultImpl,11,881,74988,14027700,74444,4150,0,2191,61881,0,0 +4,16,ModelResultImpl,11,691,56609,11960900,56125,3776,0,1943,45015,0,0 +4,17,ModelResultImpl,11,631,103459,26319900,102823,4720,0,2390,88314,0,1 +4,18,ModelResultImpl,11,2263,61989,12371400,61101,3751,0,1902,50076,0,0 +4,19,ModelResultImpl,11,575,75135,19514700,74621,4810,0,2552,60068,0,1 +4,20,ModelResultImpl,11,1069,94884,21924000,94062,5623,0,3121,77010,0,1 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/80.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/80.csv new file mode 100644 index 00000000..257b7ddb --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/80.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime,_Solution0FoundAt +5,1,InsuficientResourcesResultImpl,8,1163,301236,6700,11611,7,8030,261757,0,0, +5,2,ModelResultImpl,8,1125,214262,41193500,10675,0,7433,179009,0,1,213284 +5,3,InsuficientResourcesResultImpl,8,1097,301100,1400,10110,0,6697,266325,0,0, +5,4,ModelResultImpl,8,1202,243793,34411800,11329,0,7710,206562,0,0,242815 +5,5,ModelResultImpl,8,1130,266540,38153400,12190,0,8455,225879,0,1,265458 +5,6,ModelResultImpl,8,1136,244077,43614700,10925,0,7347,207698,0,0,243138 +5,7,ModelResultImpl,8,1263,270364,44901700,10715,0,7520,233664,0,0,269383 +5,8,ModelResultImpl,8,1062,228653,36320200,11042,0,7673,191829,0,0,227652 +5,9,ModelResultImpl,8,1060,284484,38198200,12105,0,8129,244192,0,1,283520 +5,10,ModelResultImpl,8,1087,245757,38745600,10898,0,7835,208781,0,0,244833 +5,11,InsuficientResourcesResultImpl,8,1003,302539,1700,9666,0,6798,267961,0,0, +5,12,ModelResultImpl,8,657,143583,35565200,6948,0,4448,120639,0,0,142951 +5,13,ModelResultImpl,8,1061,292041,44607000,12010,0,8656,250579,0,1,291061 +5,14,ModelResultImpl,8,1034,255307,37454100,11242,0,7789,217397,0,0,254393 +5,15,InsuficientResourcesResultImpl,8,1194,300839,1500,9997,0,7300,265245,0,0, +5,16,ModelResultImpl,8,1070,274358,38762800,11730,0,7864,235472,0,1,273383 +5,17,ModelResultImpl,8,1099,259378,84148300,11340,0,7784,221204,0,0,258553 +5,18,ModelResultImpl,8,1084,255262,38991800,11989,0,7795,215829,0,1,254328 +5,19,ModelResultImpl,8,1111,293515,47026100,12037,0,8609,252172,0,1,292504 +5,20,ModelResultImpl,8,1106,278558,32886300,12080,0,8000,237985,0,1,277745 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/warmup.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/warmup.csv new file mode 100644 index 00000000..989c2411 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Github/warmup.csv @@ -0,0 +1,7 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +1,1,ModelResultImpl,1483,2558,3108,60043900,1609,456,424,87,272,0,1 +1,2,ModelResultImpl,1483,1126,1487,9020100,931,292,1,60,256,0,1 +1,3,ModelResultImpl,1483,927,1424,9739900,827,263,0,51,217,0,0 +1,4,ModelResultImpl,1483,886,1069,8613600,495,208,1,25,97,0,0 +1,5,ModelResultImpl,1483,768,1268,9369800,856,262,0,35,223,0,0 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/100.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/100.csv new file mode 100644 index 00000000..a2628ad1 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/100.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +5,1,ModelResultImpl,12,865,91787,64960700,91078,17340,6,2469,61497,0,3 +5,2,ModelResultImpl,12,956,118267,65616400,117553,16353,0,2810,85627,0,1 +5,3,ModelResultImpl,12,900,116093,69616600,115364,17281,0,2800,82376,0,0 +5,4,ModelResultImpl,12,907,96027,78796000,95287,19233,0,2643,63089,0,0 +5,5,ModelResultImpl,12,961,133615,61595600,132840,17098,0,2970,99041,0,0 +5,6,ModelResultImpl,12,917,120673,61159000,119930,18320,0,2889,85737,0,0 +5,7,ModelResultImpl,12,941,101988,69310400,101183,18258,0,2694,69616,0,0 +5,8,ModelResultImpl,12,910,117121,58731900,116373,16751,0,2954,83990,0,1 +5,9,ModelResultImpl,12,939,98738,60204200,97988,15671,0,2643,69051,0,0 +5,10,ModelResultImpl,12,907,109216,62901700,108450,18563,0,2855,74361,0,0 +5,11,ModelResultImpl,12,989,101313,70288400,100570,19059,0,2653,68951,0,0 +5,12,ModelResultImpl,12,847,110986,71960700,110229,20031,0,2484,77376,0,0 +5,13,ModelResultImpl,12,924,99847,65101400,99083,18276,0,2732,67006,0,0 +5,14,ModelResultImpl,12,908,113484,61073000,112675,20588,0,2760,77595,0,0 +5,15,ModelResultImpl,12,859,107243,118083900,106494,16814,0,2826,74774,0,0 +5,16,ModelResultImpl,12,896,101005,60113300,100198,16591,0,2670,70482,0,0 +5,17,ModelResultImpl,12,909,150888,90178000,150032,18804,0,3644,112370,0,2 +5,18,ModelResultImpl,12,1988,224882,111051700,223272,35288,0,5245,160716,0,2 +5,19,ModelResultImpl,12,1710,180301,103042800,178853,31026,0,4421,125609,0,1 +5,20,ModelResultImpl,12,2294,236789,120962500,234776,34043,0,4964,172403,0,1 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/120.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/120.csv new file mode 100644 index 00000000..03ee084b --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/120.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +2,1,ModelResultImpl,11,1049,149253,202983100,148329,21687,8,3820,108113,0,4 +2,2,ModelResultImpl,11,1131,173214,111640800,172206,24930,0,3926,128120,0,1 +2,3,ModelResultImpl,11,1027,157782,120804000,157006,19292,0,3948,119012,0,1 +2,4,ModelResultImpl,11,1063,169577,126195200,168692,22819,0,4027,126643,0,1 +2,5,ModelResultImpl,11,984,164004,93016300,163235,23449,0,3830,121474,0,1 +2,6,ModelResultImpl,11,1005,146874,94077300,146111,20382,0,3734,108542,0,1 +2,7,ModelResultImpl,11,904,148997,92734800,148172,19769,0,3763,111141,0,1 +2,8,ModelResultImpl,11,911,145947,99103000,145197,21375,0,3757,106317,0,1 +2,9,ModelResultImpl,11,911,154022,91420700,153225,21687,0,3781,113566,0,1 +2,10,ModelResultImpl,11,994,144253,105623000,143479,19514,0,3736,106547,0,1 +2,11,ModelResultImpl,11,943,146057,85565700,145235,20168,0,3830,107696,0,1 +2,12,ModelResultImpl,11,933,153728,93877000,152956,18549,0,4136,115265,0,0 +2,13,ModelResultImpl,11,989,135785,101796800,135043,19930,0,3590,98576,0,1 +2,14,ModelResultImpl,11,942,158905,115031700,158150,21663,0,3796,118239,0,0 +2,15,ModelResultImpl,11,897,138727,116266900,137918,19116,1,3652,102641,0,0 +2,16,ModelResultImpl,11,851,145221,95232500,144453,18026,0,3913,108945,0,0 +2,17,ModelResultImpl,11,928,154148,88476300,153396,21053,0,3827,113763,0,0 +2,18,ModelResultImpl,11,859,166408,95546600,165666,22619,0,3922,123707,0,1 +2,19,ModelResultImpl,11,909,136564,91353600,135766,17841,0,3665,101835,0,0 +2,20,ModelResultImpl,11,873,147664,91153300,146866,17705,0,3874,111410,0,0 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/140.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/140.csv new file mode 100644 index 00000000..293f51a5 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/140.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,Solution1FoundAt,ExplorationInitializationTime,TransformationExecutionTime,TypeAnalysisTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime,ActivationSelectionTime,NumericalSolverSumTime,NumericalSolverProblemFormingTime,NumericalSolverSolvingTime,NumericalSolverInterpretingSolution,NumericalSolverCachingTime,NumericalSolverCallNumber,NumericalSolverCachedAnswerNumber +2,1,ModelResultImpl,49,948,55965,249,54293,1336,6134,11,17708,0,3,2,0,0,0,0,0,0,0 +2,2,ModelResultImpl,49,638,65106,310,63703,837,7067,0,20870,0,3,2,0,0,0,0,0,0,0 +2,3,ModelResultImpl,49,1929,69666,268,67267,1926,7537,0,20708,0,1,0,0,0,0,0,0,0,0 +2,4,ModelResultImpl,49,617,67091,318,65452,1078,8304,0,18694,0,1,0,0,0,0,0,0,0,0 +2,5,ModelResultImpl,49,1068,75850,145,74083,1480,8386,0,19637,0,1,0,0,0,0,0,0,0,0 +2,6,ModelResultImpl,49,785,65738,301,63408,1430,7695,0,16497,0,3,0,0,0,0,0,0,0,0 +2,7,ModelResultImpl,49,1055,85078,387,82888,1365,9313,0,22220,0,1,0,0,0,0,0,0,0,0 +2,8,ModelResultImpl,49,1189,63131,136,61246,1586,7804,0,17380,0,2,1,0,0,0,0,0,0,0 +2,9,ModelResultImpl,49,530,60098,248,58756,657,6900,0,18737,0,2,0,0,0,0,0,0,0,0 +2,10,ModelResultImpl,49,706,58634,247,56728,1023,6237,0,18909,0,1,0,0,0,0,0,0,0,0 +2,11,ModelResultImpl,49,683,55087,174,53903,749,5838,0,17665,0,1,0,0,0,0,0,0,0,0 +2,12,ModelResultImpl,49,533,69793,206,68720,625,7827,0,22340,0,1,0,0,0,0,0,0,0,0 +2,13,ModelResultImpl,49,625,58198,256,56830,781,6177,0,20134,0,2,0,0,0,0,0,0,0,0 +2,14,ModelResultImpl,49,555,66046,250,64950,664,7385,0,15860,0,0,0,0,0,0,0,0,0,0 +2,15,ModelResultImpl,49,586,96452,367,92042,1007,12651,0,23019,0,6,0,0,0,0,0,0,0,0 +2,16,ModelResultImpl,49,1523,72460,210,70549,1181,9123,1,21222,0,2,0,0,0,0,0,0,0,0 +2,17,ModelResultImpl,49,734,74551,417,72763,842,8117,0,21326,0,3,0,0,0,0,0,0,0,0 +2,18,ModelResultImpl,49,1282,75020,208,72887,1459,8671,0,22596,0,3,1,0,0,0,0,0,0,0 +2,19,ModelResultImpl,49,871,70125,286,68362,947,8755,0,18829,0,1,0,0,0,0,0,0,0,0 +2,20,ModelResultImpl,49,633,65564,149,64398,816,7912,0,15815,0,0,0,0,0,0,0,0,0,0 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/30.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/30.csv new file mode 100644 index 00000000..ec0afb94 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/30.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +2,1,ModelResultImpl,37,1267,42409,28515700,41220,5066,11,614,29095,0,1 +2,2,ModelResultImpl,37,1919,14164,22580700,12518,3986,2,344,5463,0,2 +2,3,ModelResultImpl,37,1916,41597,31164300,40290,5050,1,614,28209,0,1 +2,4,ModelResultImpl,37,2023,41518,20216100,40199,5825,0,549,27332,0,1 +2,5,ModelResultImpl,37,2052,21630,32282400,20128,4713,0,456,10817,0,1 +2,6,ModelResultImpl,37,2070,40984,24514000,39602,5997,0,528,26649,0,2 +2,7,ModelResultImpl,37,2249,40677,22780300,39309,4977,0,600,27410,0,1 +2,8,ModelResultImpl,37,1887,34102,17897400,32571,5103,0,524,21184,0,1 +2,9,ModelResultImpl,37,1826,11685,12854100,10430,3316,0,298,4382,0,1 +2,10,ModelResultImpl,37,1795,20933,19823700,19703,4431,0,435,10642,0,1 +2,11,ModelResultImpl,37,1849,33111,18648500,31757,5743,0,375,20404,0,1 +2,12,ModelResultImpl,37,1829,36099,18177300,34869,5689,0,525,22643,0,1 +2,13,ModelResultImpl,37,1875,36431,20140100,35116,5371,0,500,23462,0,1 +2,14,ModelResultImpl,37,1796,32322,24371800,31185,4939,0,493,20307,0,1 +2,15,ModelResultImpl,37,1961,43764,24819800,42470,6248,0,593,27586,0,1 +2,16,ModelResultImpl,37,1737,16231,16437300,14995,3805,0,388,7679,0,0 +2,17,ModelResultImpl,37,1685,14223,36835700,12964,3783,0,338,6108,0,1 +2,18,ModelResultImpl,37,1910,30550,21296200,29359,4813,0,517,18691,0,1 +2,19,ModelResultImpl,37,1622,30723,17831800,29572,5299,0,560,18198,0,1 +2,20,ModelResultImpl,37,1915,15410,15827800,14223,3856,0,353,7093,0,1 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/50.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/50.csv new file mode 100644 index 00000000..80122e3d --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/50.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +3,1,ModelResultImpl,16,1695,34619,47365200,33379,7951,23,1005,19203,0,0 +3,2,ModelResultImpl,16,1952,66272,40194500,65033,10142,0,1381,45195,0,1 +3,3,ModelResultImpl,16,1882,50684,57411900,49392,9412,0,1181,31167,0,2 +3,4,ModelResultImpl,16,1835,52174,29585500,50841,9443,0,1265,32497,0,1 +3,5,ModelResultImpl,16,1817,37087,24158900,35809,8374,0,1106,20620,0,1 +3,6,ModelResultImpl,16,1822,96082,35393500,94837,10814,0,1314,71854,0,1 +3,7,ModelResultImpl,16,1845,65727,37723300,64268,10857,0,1392,42620,0,1 +3,8,ModelResultImpl,16,1715,36063,56419600,34810,8195,0,1065,19928,0,2 +3,9,ModelResultImpl,16,1814,53418,68855200,52040,9364,0,1248,33127,0,1 +3,10,ModelResultImpl,16,1688,146193,34004300,144953,23393,0,2677,96521,0,2 +3,11,ModelResultImpl,16,1887,56839,38787000,55478,11029,0,1309,34905,0,1 +3,12,ModelResultImpl,16,1852,43970,32684100,42779,10114,0,1121,25234,0,1 +3,13,ModelResultImpl,16,1766,68078,29662000,66581,12700,0,1445,42619,0,1 +3,14,ModelResultImpl,16,2033,137006,39601900,135475,10041,0,1736,110352,0,1 +3,15,ModelResultImpl,16,1792,36929,30425200,35576,8499,0,1112,19855,0,1 +3,16,ModelResultImpl,16,1861,79893,19417500,78581,10278,0,1253,56995,0,0 +3,17,ModelResultImpl,16,1651,34149,32888300,33294,8334,0,1016,18514,0,1 +3,18,ModelResultImpl,16,1799,51965,35639300,50624,11417,0,1355,29874,0,0 +3,19,ModelResultImpl,16,2032,46469,44756500,45006,10308,0,1323,25809,0,1 +3,20,ModelResultImpl,16,1839,75448,32863500,74051,11465,0,1499,50558,0,1 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/80.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/80.csv new file mode 100644 index 00000000..ae7f7ca1 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/80.csv @@ -0,0 +1,22 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,_Solution0FoundAt,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime +4,1,ModelResultImpl,20,2105,122193,47975800,120819,22172,21,3111,81933,0,0 +4,2,ModelResultImpl,20,948,71430,38366700,70718,10799,0,1803,49089,0,0 +4,3,ModelResultImpl,20,907,71011,42371700,70320,12614,0,1751,47228,0,0 +4,4,ModelResultImpl,20,888,57574,43253600,56870,10097,0,1721,37819,0,0 +4,5,ModelResultImpl,20,918,50961,39099900,50235,9718,0,1667,31881,0,0 +4,6,ModelResultImpl,20,929,54262,48948700,53554,10095,0,1701,35294,0,0 +4,7,ModelResultImpl,20,914,69271,42306400,68596,12610,0,1788,45775,0,0 +4,8,ModelResultImpl,20,887,58304,42858800,57604,10861,0,1641,37653,0,0 +4,9,ModelResultImpl,20,923,61436,40388600,60755,11478,0,1812,38983,0,0 +4,10,ModelResultImpl,20,950,51010,44099800,50294,11361,0,1496,30951,0,1 +4,11,ModelResultImpl,20,879,56153,40079800,55455,11776,0,1587,35227,0,0 +4,12,ModelResultImpl,20,939,55164,41385200,54450,9786,0,1675,35778,0,0 +4,13,ModelResultImpl,20,947,59424,49539400,58684,10955,0,1776,38126,0,0 +4,14,ModelResultImpl,20,973,61843,36537600,61086,10883,0,1685,40830,0,0 +4,15,ModelResultImpl,20,867,54362,38663100,53666,10015,0,1611,35234,0,0 +4,16,ModelResultImpl,20,915,108777,49507000,108033,20987,0,2938,71959,0,1 +4,17,ModelResultImpl,20,922,55218,41448600,54548,9665,0,1657,36387,0,0 +4,18,ModelResultImpl,20,921,57210,60622400,56526,10429,0,1747,36425,0,0 +4,19,ModelResultImpl,20,911,70900,47211300,70230,11669,0,1714,48547,0,0 +4,20,ModelResultImpl,20,887,74363,36468500,73658,12552,0,1800,50208,0,0 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/warmup.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/warmup.csv new file mode 100644 index 00000000..51fae097 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/Yakindu/warmup.csv @@ -0,0 +1,3 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,Solution1FoundAt,ExplorationInitializationTime,TransformationExecutionTime,TypeAnalysisTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime,ActivationSelectionTime,NumericalSolverSumTime,NumericalSolverProblemFormingTime,NumericalSolverSolvingTime,NumericalSolverInterpretingSolution,NumericalSolverCachingTime,NumericalSolverCallNumber,NumericalSolverCachedAnswerNumber +1,1,ModelResultImpl,1214,3343,41674,560,39465,2089,5088,301,10507,0,16,2,0,0,0,0,0,0,0 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/file.csv b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/file.csv new file mode 100644 index 00000000..c3c77053 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/statistics/file.csv @@ -0,0 +1,4 @@ +Task,Run,Result,Domain to logic transformation time,Logic to solver transformation time,Solver time,Postprocessing time,TransformationExecutionTime,TypeAnalysisTime,MetricCalculationTime,StateCoderTime,StateCoderFailCount,SolutionCopyTime,_Solution0FoundAt +1,1,InsuficientResourcesResultImpl,453,3378,5255,7500,1236,131,79,245,0,0, +1,2,ModelResultImpl,453,1965,4628,31696400,1014,3,58,307,0,1,1957 + diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduGeneration.vsconfig b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduGeneration.vsconfig new file mode 100644 index 00000000..56921884 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduGeneration.vsconfig @@ -0,0 +1,106 @@ +import epackage "../../../Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/model/yakindu_simplified.ecore" +import viatra "../../../Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql" + +generate { + metamodel = { package yakindumm excluding { Synchronization}} + constraints = { package hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu } + partial-model = { "inputs/start.xmi"} + + solver = ViatraSolver + + scope = { + #node = 100 + } + + number = 1 + runs = 1 + config = { + log-level = none, + "optional-wf" = "false", + "realistic-guidance" = "Composite", + "allow-must-violations" = "false", + "domain" = "Yakindumm" + } + + statistics = "statistics/Yakindu/warmup.csv" //give different set up different filenames + debug = "debug" + output = "output/Yakindu/run_time/" +} + +// generate { +// metamodel = { package yakindumm excluding { Synchronization}} +// constraints = { package hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu } +// partial-model = { "inputs/start.xmi"} + +// solver = ViatraSolver + +// scope = { +// #node = 140 +// } + +// number = 1 +// runs = 20 +// config = { +// log-level = none, +// "optional-wf" = "false", +// "realistic-guidance" = "Composite", +// "allow-must-violations" = "false", +// "domain" = "Yakindumm" +// } + +// statistics = "statistics/Yakindu/140.csv" //give different set up different filenames +// debug = "debug" +// output = "output/Yakindu/run_time/" +// } + +// generate { +// metamodel = { package yakindumm excluding { Synchronization}} +// constraints = { package hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu } +// partial-model = { "inputs/start.xmi"} + +// solver = ViatraSolver + +// scope = { +// #node = 160 +// } + +// number = 1 +// runs = 20 +// config = { +// log-level = none, +// "optional-wf" = "false", +// "realistic-guidance" = "Composite", +// "allow-must-violations" = "false", +// "domain" = "Yakindumm" +// } + +// statistics = "statistics/Yakindu/160.csv" //give different set up different filenames +// debug = "debug" +// output = "output/Yakindu/run_time/" +// } + +// generate { +// metamodel = { package yakindumm excluding { Synchronization}} +// constraints = { package hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu } +// partial-model = { "inputs/start.xmi"} + +// solver = ViatraSolver + +// scope = { +// #node = 180 +// } + +// number = 1 +// runs = 20 +// config = { +// log-level = none, +// "optional-wf" = "false", +// "realistic-guidance" = "Composite", +// "allow-must-violations" = "false", +// "domain" = "Yakindumm" +// } + +// statistics = "statistics/Yakindu/180.csv" //give different set up different filenames +// debug = "debug" +// output = "output/Yakindu/run_time/" +// } \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/.gitignore b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/.gitignore new file mode 100644 index 00000000..17126b28 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/yakinduum/.gitignore @@ -0,0 +1,4 @@ +# ignore everything in this folder except for this folder it self + +* +!.gitignore \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.classpath b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.classpath new file mode 100644 index 00000000..c5fe8c25 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.gitignore b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.gitignore new file mode 100644 index 00000000..317e68e2 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.gitignore @@ -0,0 +1,6 @@ +/bin/ +bin/ +testInput/ +testOutput/ +xtend-gen/ +*.csv \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.project b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.project new file mode 100644 index 00000000..5154dea0 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.project @@ -0,0 +1,34 @@ + + + ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.settings/org.eclipse.jdt.core.prefs b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..0c68a61d --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.settings/org.eclipse.wst.validation.prefs b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 00000000..b0a80408 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,10 @@ +DELEGATES_PREFERENCE=delegateValidatorList +USER_BUILD_PREFERENCE=enabledBuildValidatorList +USER_MANUAL_PREFERENCE=enabledManualValidatorList +USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.701.v201810290944 +eclipse.preferences.version=1 +override=true +suspend=false +vals/org.eclipse.wst.xml.core.xml/global=FF03 +vals/org.eclipse.wst.xsd.core.xsd/global=FF02162org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator +vf.version=3 diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/Inputs/.gitignore b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/Inputs/.gitignore new file mode 100644 index 00000000..17126b28 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/Inputs/.gitignore @@ -0,0 +1,4 @@ +# ignore everything in this folder except for this folder it self + +* +!.gitignore \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/META-INF/MANIFEST.MF b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/META-INF/MANIFEST.MF new file mode 100644 index 00000000..7c4f553d --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/META-INF/MANIFEST.MF @@ -0,0 +1,30 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Graph_metrics_calculation +Bundle-SymbolicName: ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator +Bundle-Version: 1.0.0.qualifier +Automatic-Module-Name: graph_metrics_calculation +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: com.google.guava, + org.eclipse.xtext.xbase.lib, + org.eclipse.xtend.lib, + org.eclipse.xtend.lib.macro, + org.eclipse.emf.ecore;bundle-version="2.17.0", + org.eclipse.emf.ecore.xmi;bundle-version="2.15.0", + hu.bme.mit.inf.dslreasoner.viatra2logic;bundle-version="1.0.0", + hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage;bundle-version="1.0.0", + org.eclipse.viatra.dse;bundle-version="0.21.2", + org.eclipse.viatra.query.runtime.rete;bundle-version="2.1.2", + org.eclipse.viatra.addon.validation.core;bundle-version="2.1.2", + org.eclipse.collections;bundle-version="9.2.0", + org.eclipse.viatra.query.runtime.localsearch;bundle-version="2.1.2", + org.apache.log4j;bundle-version="1.2.15", + hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph;bundle-version="1.0.0", + github-graph;bundle-version="0.1.0" +Export-Package: ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app, + ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance, + ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph, + ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io, + ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics, + ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.predictor, + ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.validation diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/build.properties b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/build.properties new file mode 100644 index 00000000..34d2e4d2 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/LoopInInheritenceConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/LoopInInheritenceConstraint0.java new file mode 100644 index 00000000..c31e59e7 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/LoopInInheritenceConstraint0.java @@ -0,0 +1,79 @@ +/** +Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql +*/ +package constraints.ecore; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import ecore.LoopInInheritence; + +public class LoopInInheritenceConstraint0 implements IConstraintSpecification { + + private LoopInInheritence querySpecification; + + public LoopInInheritenceConstraint0() { + querySpecification = LoopInInheritence.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("a",signature.get("a")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "a" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/NonSymmetricOppositeConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/NonSymmetricOppositeConstraint0.java new file mode 100644 index 00000000..29b35552 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/NonSymmetricOppositeConstraint0.java @@ -0,0 +1,80 @@ +/** +Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql +*/ +package constraints.ecore; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import ecore.NonSymmetricOpposite; + +public class NonSymmetricOppositeConstraint0 implements IConstraintSpecification { + + private NonSymmetricOpposite querySpecification; + + public NonSymmetricOppositeConstraint0() { + querySpecification = NonSymmetricOpposite.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("a",signature.get("a")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "a" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + "b" + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/OppositeDifferentClassConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/OppositeDifferentClassConstraint0.java new file mode 100644 index 00000000..9ef4e35e --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/ecore/OppositeDifferentClassConstraint0.java @@ -0,0 +1,79 @@ +/** +Generated from platform:/resource/SocialNetwork_plugin/queries/queries/Ecore.vql +*/ +package constraints.ecore; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import ecore.OppositeDifferentClass; + +public class OppositeDifferentClassConstraint0 implements IConstraintSpecification { + + private OppositeDifferentClass querySpecification; + + public OppositeDifferentClassConstraint0() { + querySpecification = OppositeDifferentClass.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("a",signature.get("a")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "a" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/ChoiceHasNoIncomingConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/ChoiceHasNoIncomingConstraint0.java new file mode 100644 index 00000000..dbc51a5e --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/ChoiceHasNoIncomingConstraint0.java @@ -0,0 +1,79 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.ChoiceHasNoIncoming; + +public class ChoiceHasNoIncomingConstraint0 implements IConstraintSpecification { + + private ChoiceHasNoIncoming querySpecification; + + public ChoiceHasNoIncomingConstraint0() { + querySpecification = ChoiceHasNoIncoming.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("c",signature.get("c")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "c" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/ChoiceHasNoOutgoingConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/ChoiceHasNoOutgoingConstraint0.java new file mode 100644 index 00000000..bdddd5b5 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/ChoiceHasNoOutgoingConstraint0.java @@ -0,0 +1,79 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.ChoiceHasNoOutgoing; + +public class ChoiceHasNoOutgoingConstraint0 implements IConstraintSpecification { + + private ChoiceHasNoOutgoing querySpecification; + + public ChoiceHasNoOutgoingConstraint0() { + querySpecification = ChoiceHasNoOutgoing.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("c",signature.get("c")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "c" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/IncomingToEntryConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/IncomingToEntryConstraint0.java new file mode 100644 index 00000000..b49d9474 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/IncomingToEntryConstraint0.java @@ -0,0 +1,80 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.IncomingToEntry; + +public class IncomingToEntryConstraint0 implements IConstraintSpecification { + + private IncomingToEntry querySpecification; + + public IncomingToEntryConstraint0() { + querySpecification = IncomingToEntry.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("e",signature.get("e")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "e" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + "t" + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/MultipleEntryInRegionConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/MultipleEntryInRegionConstraint0.java new file mode 100644 index 00000000..535e7eee --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/MultipleEntryInRegionConstraint0.java @@ -0,0 +1,79 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.MultipleEntryInRegion; + +public class MultipleEntryInRegionConstraint0 implements IConstraintSpecification { + + private MultipleEntryInRegion querySpecification; + + public MultipleEntryInRegionConstraint0() { + querySpecification = MultipleEntryInRegion.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("r",signature.get("r")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "r" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/MultipleTransitionFromEntryConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/MultipleTransitionFromEntryConstraint0.java new file mode 100644 index 00000000..a41b2fc1 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/MultipleTransitionFromEntryConstraint0.java @@ -0,0 +1,81 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.MultipleTransitionFromEntry; + +public class MultipleTransitionFromEntryConstraint0 implements IConstraintSpecification { + + private MultipleTransitionFromEntry querySpecification; + + public MultipleTransitionFromEntryConstraint0() { + querySpecification = MultipleTransitionFromEntry.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("e",signature.get("e")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "e" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + "t1", + "t2" + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoEntryInRegionConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoEntryInRegionConstraint0.java new file mode 100644 index 00000000..9eb7783f --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoEntryInRegionConstraint0.java @@ -0,0 +1,79 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.NoEntryInRegion; + +public class NoEntryInRegionConstraint0 implements IConstraintSpecification { + + private NoEntryInRegion querySpecification; + + public NoEntryInRegionConstraint0() { + querySpecification = NoEntryInRegion.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("r1",signature.get("r1")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "r1" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoOutgoingTransitionFromEntryConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoOutgoingTransitionFromEntryConstraint0.java new file mode 100644 index 00000000..35d54e8e --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoOutgoingTransitionFromEntryConstraint0.java @@ -0,0 +1,79 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.NoOutgoingTransitionFromEntry; + +public class NoOutgoingTransitionFromEntryConstraint0 implements IConstraintSpecification { + + private NoOutgoingTransitionFromEntry querySpecification; + + public NoOutgoingTransitionFromEntryConstraint0() { + querySpecification = NoOutgoingTransitionFromEntry.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("e",signature.get("e")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "e" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoStateInRegionConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoStateInRegionConstraint0.java new file mode 100644 index 00000000..49c0063f --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/NoStateInRegionConstraint0.java @@ -0,0 +1,79 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.NoStateInRegion; + +public class NoStateInRegionConstraint0 implements IConstraintSpecification { + + private NoStateInRegion querySpecification; + + public NoStateInRegionConstraint0() { + querySpecification = NoStateInRegion.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("region",signature.get("region")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "region" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/OutgoingFromExitConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/OutgoingFromExitConstraint0.java new file mode 100644 index 00000000..ddb907ff --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/OutgoingFromExitConstraint0.java @@ -0,0 +1,80 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.OutgoingFromExit; + +public class OutgoingFromExitConstraint0 implements IConstraintSpecification { + + private OutgoingFromExit querySpecification; + + public OutgoingFromExitConstraint0() { + querySpecification = OutgoingFromExit.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("e",signature.get("e")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "e" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + "t" + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/OutgoingFromFinalConstraint0.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/OutgoingFromFinalConstraint0.java new file mode 100644 index 00000000..3b2949fd --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/constraints/yakindumm/OutgoingFromFinalConstraint0.java @@ -0,0 +1,80 @@ +/** +Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +*/ +package constraints.yakindumm; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Arrays; + +import org.eclipse.viatra.addon.validation.core.api.Severity; +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher; + +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.OutgoingFromFinal; + +public class OutgoingFromFinalConstraint0 implements IConstraintSpecification { + + private OutgoingFromFinal querySpecification; + + public OutgoingFromFinalConstraint0() { + querySpecification = OutgoingFromFinal.instance(); + } + + @Override + public String getMessageFormat() { + return "error"; + } + + + @Override + public Map getKeyObjects(IPatternMatch signature) { + Map map = new HashMap<>(); + map.put("f",signature.get("f")); + return map; + } + + @Override + public List getKeyNames() { + List keyNames = Arrays.asList( + "f" + ); + return keyNames; + } + + @Override + public List getPropertyNames() { + List propertyNames = Arrays.asList( + "t" + ); + return propertyNames; + } + + @Override + public Set> getSymmetricPropertyNames() { + Set> symmetricPropertyNamesSet = new HashSet<>(); + return symmetricPropertyNamesSet; + } + + @Override + public Set> getSymmetricKeyNames() { + Set> symmetricKeyNamesSet = new HashSet<>(); + return symmetricKeyNamesSet; + } + + @Override + public Severity getSeverity() { + return Severity.ERROR; + } + + @Override + public IQuerySpecification> getQuerySpecification() { + return querySpecification; + } + +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/.gitignore b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/.gitignore new file mode 100644 index 00000000..c42ca056 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/.gitignore @@ -0,0 +1,8 @@ +/.Ecore_pattern.java._trace +/.MoreThenFiveSuperTypes.java._trace +/.DirectSupertype.java._trace +/.Ecore.java._trace +/.LoopInInheritence.java._trace +/.NonSymmetricOpposite.java._trace +/.Opposite.java._trace +/.OppositeDifferentClass.java._trace diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/DirectSupertype.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/DirectSupertype.java new file mode 100644 index 00000000..a6ffad45 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/DirectSupertype.java @@ -0,0 +1,692 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/ecore/Ecore.vql + */ +package ecore; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         pattern directSupertype(a: EClass, b:EClass) {
+ *         	EClass.eSuperTypes(a,b);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class DirectSupertype extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the ecore.directSupertype pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EClass fA; + + private EClass fB; + + private static List parameterNames = makeImmutableList("a", "b"); + + private Match(final EClass pA, final EClass pB) { + this.fA = pA; + this.fB = pB; + } + + @Override + public Object get(final String parameterName) { + if ("a".equals(parameterName)) return this.fA; + if ("b".equals(parameterName)) return this.fB; + return null; + } + + public EClass getA() { + return this.fA; + } + + public EClass getB() { + return this.fB; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EClass) newValue; + return true; + } + if ("b".equals(parameterName) ) { + this.fB = (EClass) newValue; + return true; + } + return false; + } + + public void setA(final EClass pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + public void setB(final EClass pB) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fB = pB; + } + + @Override + public String patternName() { + return "ecore.directSupertype"; + } + + @Override + public List parameterNames() { + return DirectSupertype.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA, fB}; + } + + @Override + public DirectSupertype.Match toImmutable() { + return isMutable() ? newMatch(fA, fB) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA) + ", "); + result.append("\"b\"=" + prettyPrintValue(fB)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA, fB); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof DirectSupertype.Match)) { + DirectSupertype.Match other = (DirectSupertype.Match) obj; + return Objects.equals(fA, other.fA) && Objects.equals(fB, other.fB); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public DirectSupertype specification() { + return DirectSupertype.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static DirectSupertype.Match newEmptyMatch() { + return new Mutable(null, null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static DirectSupertype.Match newMutableMatch(final EClass pA, final EClass pB) { + return new Mutable(pA, pB); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public static DirectSupertype.Match newMatch(final EClass pA, final EClass pB) { + return new Immutable(pA, pB); + } + + private static final class Mutable extends DirectSupertype.Match { + Mutable(final EClass pA, final EClass pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends DirectSupertype.Match { + Immutable(final EClass pA, final EClass pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the ecore.directSupertype pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * pattern directSupertype(a: EClass, b:EClass) {
+   * 	EClass.eSuperTypes(a,b);
+   * }
+   * 
+ * + * @see Match + * @see DirectSupertype + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static DirectSupertype.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static DirectSupertype.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final int POSITION_B = 1; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(DirectSupertype.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EClass pA, final EClass pB) { + return rawStreamAllMatches(new Object[]{pA, pB}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EClass pA, final EClass pB) { + return rawStreamAllMatches(new Object[]{pA, pB}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EClass pA, final EClass pB) { + return rawGetOneArbitraryMatch(new Object[]{pA, pB}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EClass pA, final EClass pB) { + return rawHasMatch(new Object[]{pA, pB}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EClass pA, final EClass pB) { + return rawCountMatches(new Object[]{pA, pB}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EClass pA, final EClass pB, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA, pB}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public DirectSupertype.Match newMatch(final EClass pA, final EClass pB) { + return DirectSupertype.Match.newMatch(pA, pB); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EClass.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final DirectSupertype.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final EClass pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final DirectSupertype.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final EClass pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfb(final Object[] parameters) { + return rawStreamAllValues(POSITION_B, parameters).map(EClass.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final DirectSupertype.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final EClass pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final DirectSupertype.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final EClass pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}).collect(Collectors.toSet()); + } + + @Override + protected DirectSupertype.Match tupleToMatch(final Tuple t) { + try { + return DirectSupertype.Match.newMatch((EClass) t.get(POSITION_A), (EClass) t.get(POSITION_B)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected DirectSupertype.Match arrayToMatch(final Object[] match) { + try { + return DirectSupertype.Match.newMatch((EClass) match[POSITION_A], (EClass) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected DirectSupertype.Match arrayToMatchMutable(final Object[] match) { + try { + return DirectSupertype.Match.newMutableMatch((EClass) match[POSITION_A], (EClass) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return DirectSupertype.instance(); + } + } + + private DirectSupertype() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static DirectSupertype instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected DirectSupertype.Matcher instantiate(final ViatraQueryEngine engine) { + return DirectSupertype.Matcher.on(engine); + } + + @Override + public DirectSupertype.Matcher instantiate() { + return DirectSupertype.Matcher.create(); + } + + @Override + public DirectSupertype.Match newEmptyMatch() { + return DirectSupertype.Match.newEmptyMatch(); + } + + @Override + public DirectSupertype.Match newMatch(final Object... parameters) { + return DirectSupertype.Match.newMatch((org.eclipse.emf.ecore.EClass) parameters[0], (org.eclipse.emf.ecore.EClass) parameters[1]); + } + + /** + * Inner class allowing the singleton instance of {@link JvmGenericType: ecore.DirectSupertype (visibility: PUBLIC, simpleName: DirectSupertype, identifier: ecore.DirectSupertype, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link JvmGenericType: ecore.DirectSupertype (visibility: PUBLIC, simpleName: DirectSupertype, identifier: ecore.DirectSupertype, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final DirectSupertype INSTANCE = new DirectSupertype(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final DirectSupertype.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); + + private final PParameter parameter_b = new PParameter("b", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a, parameter_b); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "ecore.directSupertype"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a","b"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + PVariable var_b = body.getOrCreateVariableByName("b"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a), + new ExportedParameter(body, var_b, parameter_b) + )); + // EClass.eSuperTypes(a,b) + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass", "eSuperTypes"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + new Equality(body, var__virtual_0_, var_b); + bodies.add(body); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/Ecore.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/Ecore.java new file mode 100644 index 00000000..bca43a17 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/Ecore.java @@ -0,0 +1,97 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/ecore/Ecore.vql + */ +package ecore; + +import ecore.DirectSupertype; +import ecore.LoopInInheritence; +import ecore.NonSymmetricOpposite; +import ecore.Opposite; +import ecore.OppositeDifferentClass; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; + +/** + * A pattern group formed of all public patterns defined in Ecore.vql. + * + *

Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare + * a VIATRA Query engine for matching all patterns originally defined in file Ecore.vql, + * in order to achieve better performance than one-by-one on-demand matcher initialization. + * + *

From package ecore, the group contains the definition of the following patterns:

    + *
  • directSupertype
  • + *
  • loopInInheritence
  • + *
  • opposite
  • + *
  • oppositeDifferentClass
  • + *
  • nonSymmetricOpposite
  • + *
+ * + * @see IQueryGroup + * + */ +@SuppressWarnings("all") +public final class Ecore extends BaseGeneratedPatternGroup { + /** + * Access the pattern group. + * + * @return the singleton instance of the group + * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications + * + */ + public static Ecore instance() { + if (INSTANCE == null) { + INSTANCE = new Ecore(); + } + return INSTANCE; + } + + private static Ecore INSTANCE; + + private Ecore() { + querySpecifications.add(DirectSupertype.instance()); + querySpecifications.add(LoopInInheritence.instance()); + querySpecifications.add(Opposite.instance()); + querySpecifications.add(OppositeDifferentClass.instance()); + querySpecifications.add(NonSymmetricOpposite.instance()); + } + + public DirectSupertype getDirectSupertype() { + return DirectSupertype.instance(); + } + + public DirectSupertype.Matcher getDirectSupertype(final ViatraQueryEngine engine) { + return DirectSupertype.Matcher.on(engine); + } + + public LoopInInheritence getLoopInInheritence() { + return LoopInInheritence.instance(); + } + + public LoopInInheritence.Matcher getLoopInInheritence(final ViatraQueryEngine engine) { + return LoopInInheritence.Matcher.on(engine); + } + + public Opposite getOpposite() { + return Opposite.instance(); + } + + public Opposite.Matcher getOpposite(final ViatraQueryEngine engine) { + return Opposite.Matcher.on(engine); + } + + public OppositeDifferentClass getOppositeDifferentClass() { + return OppositeDifferentClass.instance(); + } + + public OppositeDifferentClass.Matcher getOppositeDifferentClass(final ViatraQueryEngine engine) { + return OppositeDifferentClass.Matcher.on(engine); + } + + public NonSymmetricOpposite getNonSymmetricOpposite() { + return NonSymmetricOpposite.instance(); + } + + public NonSymmetricOpposite.Matcher getNonSymmetricOpposite(final ViatraQueryEngine engine) { + return NonSymmetricOpposite.Matcher.on(engine); + } +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/LoopInInheritence.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/LoopInInheritence.java new file mode 100644 index 00000000..fb14941f --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/LoopInInheritence.java @@ -0,0 +1,548 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/ecore/Ecore.vql + */ +package ecore; + +import ecore.DirectSupertype; +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.BinaryTransitiveClosure; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         {@literal @}Constraint(key={a}, severity="error", message="error")
+ *         pattern loopInInheritence(a: EClass) {
+ *         	find directSupertype+(a,a);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class LoopInInheritence extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the ecore.loopInInheritence pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EClass fA; + + private static List parameterNames = makeImmutableList("a"); + + private Match(final EClass pA) { + this.fA = pA; + } + + @Override + public Object get(final String parameterName) { + if ("a".equals(parameterName)) return this.fA; + return null; + } + + public EClass getA() { + return this.fA; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EClass) newValue; + return true; + } + return false; + } + + public void setA(final EClass pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + @Override + public String patternName() { + return "ecore.loopInInheritence"; + } + + @Override + public List parameterNames() { + return LoopInInheritence.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA}; + } + + @Override + public LoopInInheritence.Match toImmutable() { + return isMutable() ? newMatch(fA) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof LoopInInheritence.Match)) { + LoopInInheritence.Match other = (LoopInInheritence.Match) obj; + return Objects.equals(fA, other.fA); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public LoopInInheritence specification() { + return LoopInInheritence.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static LoopInInheritence.Match newEmptyMatch() { + return new Mutable(null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static LoopInInheritence.Match newMutableMatch(final EClass pA) { + return new Mutable(pA); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the (partial) match object. + * + */ + public static LoopInInheritence.Match newMatch(final EClass pA) { + return new Immutable(pA); + } + + private static final class Mutable extends LoopInInheritence.Match { + Mutable(final EClass pA) { + super(pA); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends LoopInInheritence.Match { + Immutable(final EClass pA) { + super(pA); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the ecore.loopInInheritence pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * {@literal @}Constraint(key={a}, severity="error", message="error")
+   * pattern loopInInheritence(a: EClass) {
+   * 	find directSupertype+(a,a);
+   * }
+   * 
+ * + * @see Match + * @see LoopInInheritence + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static LoopInInheritence.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static LoopInInheritence.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(LoopInInheritence.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EClass pA) { + return rawStreamAllMatches(new Object[]{pA}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EClass pA) { + return rawStreamAllMatches(new Object[]{pA}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EClass pA) { + return rawGetOneArbitraryMatch(new Object[]{pA}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EClass pA) { + return rawHasMatch(new Object[]{pA}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EClass pA) { + return rawCountMatches(new Object[]{pA}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EClass pA, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the (partial) match object. + * + */ + public LoopInInheritence.Match newMatch(final EClass pA) { + return LoopInInheritence.Match.newMatch(pA); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EClass.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + @Override + protected LoopInInheritence.Match tupleToMatch(final Tuple t) { + try { + return LoopInInheritence.Match.newMatch((EClass) t.get(POSITION_A)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected LoopInInheritence.Match arrayToMatch(final Object[] match) { + try { + return LoopInInheritence.Match.newMatch((EClass) match[POSITION_A]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected LoopInInheritence.Match arrayToMatchMutable(final Object[] match) { + try { + return LoopInInheritence.Match.newMutableMatch((EClass) match[POSITION_A]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return LoopInInheritence.instance(); + } + } + + private LoopInInheritence() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static LoopInInheritence instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected LoopInInheritence.Matcher instantiate(final ViatraQueryEngine engine) { + return LoopInInheritence.Matcher.on(engine); + } + + @Override + public LoopInInheritence.Matcher instantiate() { + return LoopInInheritence.Matcher.create(); + } + + @Override + public LoopInInheritence.Match newEmptyMatch() { + return LoopInInheritence.Match.newEmptyMatch(); + } + + @Override + public LoopInInheritence.Match newMatch(final Object... parameters) { + return LoopInInheritence.Match.newMatch((org.eclipse.emf.ecore.EClass) parameters[0]); + } + + /** + * Inner class allowing the singleton instance of {@link JvmGenericType: ecore.LoopInInheritence (visibility: PUBLIC, simpleName: LoopInInheritence, identifier: ecore.LoopInInheritence, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link JvmGenericType: ecore.LoopInInheritence (visibility: PUBLIC, simpleName: LoopInInheritence, identifier: ecore.LoopInInheritence, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final LoopInInheritence INSTANCE = new LoopInInheritence(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final LoopInInheritence.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "ecore.loopInInheritence"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a) + )); + // find directSupertype+(a,a) + new BinaryTransitiveClosure(body, Tuples.flatTupleOf(var_a, var_a), DirectSupertype.instance().getInternalQueryRepresentation()); + bodies.add(body); + } + { + PAnnotation annotation = new PAnnotation("Constraint"); + annotation.addAttribute("key", Arrays.asList(new Object[] { + new ParameterReference("a") + })); + annotation.addAttribute("severity", "error"); + annotation.addAttribute("message", "error"); + addAnnotation(annotation); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/NonSymmetricOpposite.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/NonSymmetricOpposite.java new file mode 100644 index 00000000..d230e3f4 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/NonSymmetricOpposite.java @@ -0,0 +1,707 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/ecore/Ecore.vql + */ +package ecore; + +import ecore.Opposite; +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         {@literal @}Constraint(key={a}, severity="error", message="error")
+ *         pattern nonSymmetricOpposite(a:EReference, b:EReference) {
+ *         	find opposite(a,b);
+ *         	neg find opposite(b,a);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class NonSymmetricOpposite extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the ecore.nonSymmetricOpposite pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EReference fA; + + private EReference fB; + + private static List parameterNames = makeImmutableList("a", "b"); + + private Match(final EReference pA, final EReference pB) { + this.fA = pA; + this.fB = pB; + } + + @Override + public Object get(final String parameterName) { + if ("a".equals(parameterName)) return this.fA; + if ("b".equals(parameterName)) return this.fB; + return null; + } + + public EReference getA() { + return this.fA; + } + + public EReference getB() { + return this.fB; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EReference) newValue; + return true; + } + if ("b".equals(parameterName) ) { + this.fB = (EReference) newValue; + return true; + } + return false; + } + + public void setA(final EReference pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + public void setB(final EReference pB) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fB = pB; + } + + @Override + public String patternName() { + return "ecore.nonSymmetricOpposite"; + } + + @Override + public List parameterNames() { + return NonSymmetricOpposite.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA, fB}; + } + + @Override + public NonSymmetricOpposite.Match toImmutable() { + return isMutable() ? newMatch(fA, fB) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA) + ", "); + result.append("\"b\"=" + prettyPrintValue(fB)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA, fB); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof NonSymmetricOpposite.Match)) { + NonSymmetricOpposite.Match other = (NonSymmetricOpposite.Match) obj; + return Objects.equals(fA, other.fA) && Objects.equals(fB, other.fB); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public NonSymmetricOpposite specification() { + return NonSymmetricOpposite.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static NonSymmetricOpposite.Match newEmptyMatch() { + return new Mutable(null, null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static NonSymmetricOpposite.Match newMutableMatch(final EReference pA, final EReference pB) { + return new Mutable(pA, pB); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public static NonSymmetricOpposite.Match newMatch(final EReference pA, final EReference pB) { + return new Immutable(pA, pB); + } + + private static final class Mutable extends NonSymmetricOpposite.Match { + Mutable(final EReference pA, final EReference pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends NonSymmetricOpposite.Match { + Immutable(final EReference pA, final EReference pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the ecore.nonSymmetricOpposite pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * {@literal @}Constraint(key={a}, severity="error", message="error")
+   * pattern nonSymmetricOpposite(a:EReference, b:EReference) {
+   * 	find opposite(a,b);
+   * 	neg find opposite(b,a);
+   * }
+   * 
+ * + * @see Match + * @see NonSymmetricOpposite + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static NonSymmetricOpposite.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static NonSymmetricOpposite.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final int POSITION_B = 1; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NonSymmetricOpposite.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EReference pA, final EReference pB) { + return rawStreamAllMatches(new Object[]{pA, pB}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EReference pA, final EReference pB) { + return rawStreamAllMatches(new Object[]{pA, pB}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EReference pA, final EReference pB) { + return rawGetOneArbitraryMatch(new Object[]{pA, pB}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EReference pA, final EReference pB) { + return rawHasMatch(new Object[]{pA, pB}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EReference pA, final EReference pB) { + return rawCountMatches(new Object[]{pA, pB}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EReference pA, final EReference pB, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA, pB}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public NonSymmetricOpposite.Match newMatch(final EReference pA, final EReference pB) { + return NonSymmetricOpposite.Match.newMatch(pA, pB); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final NonSymmetricOpposite.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final EReference pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final NonSymmetricOpposite.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final EReference pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfb(final Object[] parameters) { + return rawStreamAllValues(POSITION_B, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final NonSymmetricOpposite.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final EReference pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final NonSymmetricOpposite.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final EReference pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}).collect(Collectors.toSet()); + } + + @Override + protected NonSymmetricOpposite.Match tupleToMatch(final Tuple t) { + try { + return NonSymmetricOpposite.Match.newMatch((EReference) t.get(POSITION_A), (EReference) t.get(POSITION_B)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected NonSymmetricOpposite.Match arrayToMatch(final Object[] match) { + try { + return NonSymmetricOpposite.Match.newMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected NonSymmetricOpposite.Match arrayToMatchMutable(final Object[] match) { + try { + return NonSymmetricOpposite.Match.newMutableMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return NonSymmetricOpposite.instance(); + } + } + + private NonSymmetricOpposite() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static NonSymmetricOpposite instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected NonSymmetricOpposite.Matcher instantiate(final ViatraQueryEngine engine) { + return NonSymmetricOpposite.Matcher.on(engine); + } + + @Override + public NonSymmetricOpposite.Matcher instantiate() { + return NonSymmetricOpposite.Matcher.create(); + } + + @Override + public NonSymmetricOpposite.Match newEmptyMatch() { + return NonSymmetricOpposite.Match.newEmptyMatch(); + } + + @Override + public NonSymmetricOpposite.Match newMatch(final Object... parameters) { + return NonSymmetricOpposite.Match.newMatch((org.eclipse.emf.ecore.EReference) parameters[0], (org.eclipse.emf.ecore.EReference) parameters[1]); + } + + /** + * Inner class allowing the singleton instance of {@link JvmGenericType: ecore.NonSymmetricOpposite (visibility: PUBLIC, simpleName: NonSymmetricOpposite, identifier: ecore.NonSymmetricOpposite, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link JvmGenericType: ecore.NonSymmetricOpposite (visibility: PUBLIC, simpleName: NonSymmetricOpposite, identifier: ecore.NonSymmetricOpposite, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final NonSymmetricOpposite INSTANCE = new NonSymmetricOpposite(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final NonSymmetricOpposite.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final PParameter parameter_b = new PParameter("b", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a, parameter_b); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "ecore.nonSymmetricOpposite"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a","b"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + PVariable var_b = body.getOrCreateVariableByName("b"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a), + new ExportedParameter(body, var_b, parameter_b) + )); + // find opposite(a,b) + new PositivePatternCall(body, Tuples.flatTupleOf(var_a, var_b), Opposite.instance().getInternalQueryRepresentation()); + // neg find opposite(b,a) + new NegativePatternCall(body, Tuples.flatTupleOf(var_b, var_a), Opposite.instance().getInternalQueryRepresentation()); + bodies.add(body); + } + { + PAnnotation annotation = new PAnnotation("Constraint"); + annotation.addAttribute("key", Arrays.asList(new Object[] { + new ParameterReference("a") + })); + annotation.addAttribute("severity", "error"); + annotation.addAttribute("message", "error"); + addAnnotation(annotation); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/Opposite.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/Opposite.java new file mode 100644 index 00000000..d826f072 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/Opposite.java @@ -0,0 +1,693 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/ecore/Ecore.vql + */ +package ecore; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         pattern opposite(a:EReference, b: EReference) {
+ *         	EReference.eOpposite(a,b);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class Opposite extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the ecore.opposite pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EReference fA; + + private EReference fB; + + private static List parameterNames = makeImmutableList("a", "b"); + + private Match(final EReference pA, final EReference pB) { + this.fA = pA; + this.fB = pB; + } + + @Override + public Object get(final String parameterName) { + if ("a".equals(parameterName)) return this.fA; + if ("b".equals(parameterName)) return this.fB; + return null; + } + + public EReference getA() { + return this.fA; + } + + public EReference getB() { + return this.fB; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EReference) newValue; + return true; + } + if ("b".equals(parameterName) ) { + this.fB = (EReference) newValue; + return true; + } + return false; + } + + public void setA(final EReference pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + public void setB(final EReference pB) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fB = pB; + } + + @Override + public String patternName() { + return "ecore.opposite"; + } + + @Override + public List parameterNames() { + return Opposite.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA, fB}; + } + + @Override + public Opposite.Match toImmutable() { + return isMutable() ? newMatch(fA, fB) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA) + ", "); + result.append("\"b\"=" + prettyPrintValue(fB)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA, fB); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof Opposite.Match)) { + Opposite.Match other = (Opposite.Match) obj; + return Objects.equals(fA, other.fA) && Objects.equals(fB, other.fB); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public Opposite specification() { + return Opposite.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static Opposite.Match newEmptyMatch() { + return new Mutable(null, null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static Opposite.Match newMutableMatch(final EReference pA, final EReference pB) { + return new Mutable(pA, pB); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public static Opposite.Match newMatch(final EReference pA, final EReference pB) { + return new Immutable(pA, pB); + } + + private static final class Mutable extends Opposite.Match { + Mutable(final EReference pA, final EReference pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends Opposite.Match { + Immutable(final EReference pA, final EReference pB) { + super(pA, pB); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the ecore.opposite pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * pattern opposite(a:EReference, b: EReference) {
+   * 	EReference.eOpposite(a,b);
+   * }
+   * 
+ * + * @see Match + * @see Opposite + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static Opposite.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static Opposite.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final int POSITION_B = 1; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Opposite.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EReference pA, final EReference pB) { + return rawStreamAllMatches(new Object[]{pA, pB}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EReference pA, final EReference pB) { + return rawStreamAllMatches(new Object[]{pA, pB}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EReference pA, final EReference pB) { + return rawGetOneArbitraryMatch(new Object[]{pA, pB}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EReference pA, final EReference pB) { + return rawHasMatch(new Object[]{pA, pB}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EReference pA, final EReference pB) { + return rawCountMatches(new Object[]{pA, pB}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EReference pA, final EReference pB, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA, pB}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param pB the fixed value of pattern parameter b, or null if not bound. + * @return the (partial) match object. + * + */ + public Opposite.Match newMatch(final EReference pA, final EReference pB) { + return Opposite.Match.newMatch(pA, pB); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final Opposite.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for a. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa(final EReference pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final Opposite.Match partialMatch) { + return rawStreamAllValuesOfa(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa(final EReference pB) { + return rawStreamAllValuesOfa(new Object[]{null, pB}).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfb(final Object[] parameters) { + return rawStreamAllValues(POSITION_B, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb() { + return rawStreamAllValuesOfb(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final Opposite.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for b. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfb(final EReference pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final Opposite.Match partialMatch) { + return rawStreamAllValuesOfb(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for b. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfb(final EReference pA) { + return rawStreamAllValuesOfb(new Object[]{pA, null}).collect(Collectors.toSet()); + } + + @Override + protected Opposite.Match tupleToMatch(final Tuple t) { + try { + return Opposite.Match.newMatch((EReference) t.get(POSITION_A), (EReference) t.get(POSITION_B)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected Opposite.Match arrayToMatch(final Object[] match) { + try { + return Opposite.Match.newMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected Opposite.Match arrayToMatchMutable(final Object[] match) { + try { + return Opposite.Match.newMutableMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return Opposite.instance(); + } + } + + private Opposite() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static Opposite instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected Opposite.Matcher instantiate(final ViatraQueryEngine engine) { + return Opposite.Matcher.on(engine); + } + + @Override + public Opposite.Matcher instantiate() { + return Opposite.Matcher.create(); + } + + @Override + public Opposite.Match newEmptyMatch() { + return Opposite.Match.newEmptyMatch(); + } + + @Override + public Opposite.Match newMatch(final Object... parameters) { + return Opposite.Match.newMatch((org.eclipse.emf.ecore.EReference) parameters[0], (org.eclipse.emf.ecore.EReference) parameters[1]); + } + + /** + * Inner class allowing the singleton instance of {@link JvmGenericType: ecore.Opposite (visibility: PUBLIC, simpleName: Opposite, identifier: ecore.Opposite, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link JvmGenericType: ecore.Opposite (visibility: PUBLIC, simpleName: Opposite, identifier: ecore.Opposite, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final Opposite INSTANCE = new Opposite(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final Opposite.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final PParameter parameter_b = new PParameter("b", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a, parameter_b); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "ecore.opposite"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a","b"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + PVariable var_b = body.getOrCreateVariableByName("b"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a), + new ExportedParameter(body, var_b, parameter_b) + )); + // EReference.eOpposite(a,b) + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference", "eOpposite"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + new Equality(body, var__virtual_0_, var_b); + bodies.add(body); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/OppositeDifferentClass.java b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/OppositeDifferentClass.java new file mode 100644 index 00000000..3a0df648 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/constraints/ecore/OppositeDifferentClass.java @@ -0,0 +1,577 @@ +/** + * Generated from platform:/resource/SocialNetwork_plugin/queries/ecore/Ecore.vql + */ +package ecore; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         {@literal @}Constraint(key={a}, severity="error", message="error")
+ *         pattern oppositeDifferentClass(a:EReference) {
+ *         	EReference.eOpposite(a,b);
+ *         	EReference.eContainingClass(a,aContaining);
+ *         	EReference.eType(b,bTarget);
+ *         	aContaining != bTarget;
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class OppositeDifferentClass extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the ecore.oppositeDifferentClass pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private EReference fA; + + private static List parameterNames = makeImmutableList("a"); + + private Match(final EReference pA) { + this.fA = pA; + } + + @Override + public Object get(final String parameterName) { + if ("a".equals(parameterName)) return this.fA; + return null; + } + + public EReference getA() { + return this.fA; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("a".equals(parameterName) ) { + this.fA = (EReference) newValue; + return true; + } + return false; + } + + public void setA(final EReference pA) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fA = pA; + } + + @Override + public String patternName() { + return "ecore.oppositeDifferentClass"; + } + + @Override + public List parameterNames() { + return OppositeDifferentClass.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fA}; + } + + @Override + public OppositeDifferentClass.Match toImmutable() { + return isMutable() ? newMatch(fA) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"a\"=" + prettyPrintValue(fA)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fA); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof OppositeDifferentClass.Match)) { + OppositeDifferentClass.Match other = (OppositeDifferentClass.Match) obj; + return Objects.equals(fA, other.fA); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public OppositeDifferentClass specification() { + return OppositeDifferentClass.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static OppositeDifferentClass.Match newEmptyMatch() { + return new Mutable(null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static OppositeDifferentClass.Match newMutableMatch(final EReference pA) { + return new Mutable(pA); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the (partial) match object. + * + */ + public static OppositeDifferentClass.Match newMatch(final EReference pA) { + return new Immutable(pA); + } + + private static final class Mutable extends OppositeDifferentClass.Match { + Mutable(final EReference pA) { + super(pA); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends OppositeDifferentClass.Match { + Immutable(final EReference pA) { + super(pA); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the ecore.oppositeDifferentClass pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * {@literal @}Constraint(key={a}, severity="error", message="error")
+   * pattern oppositeDifferentClass(a:EReference) {
+   * 	EReference.eOpposite(a,b);
+   * 	EReference.eContainingClass(a,aContaining);
+   * 	EReference.eType(b,bTarget);
+   * 	aContaining != bTarget;
+   * }
+   * 
+ * + * @see Match + * @see OppositeDifferentClass + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static OppositeDifferentClass.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static OppositeDifferentClass.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_A = 0; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(OppositeDifferentClass.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final EReference pA) { + return rawStreamAllMatches(new Object[]{pA}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final EReference pA) { + return rawStreamAllMatches(new Object[]{pA}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final EReference pA) { + return rawGetOneArbitraryMatch(new Object[]{pA}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final EReference pA) { + return rawHasMatch(new Object[]{pA}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final EReference pA) { + return rawCountMatches(new Object[]{pA}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final EReference pA, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pA}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pA the fixed value of pattern parameter a, or null if not bound. + * @return the (partial) match object. + * + */ + public OppositeDifferentClass.Match newMatch(final EReference pA) { + return OppositeDifferentClass.Match.newMatch(pA); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfa(final Object[] parameters) { + return rawStreamAllValues(POSITION_A, parameters).map(EReference.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for a. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfa() { + return rawStreamAllValuesOfa(emptyArray()); + } + + @Override + protected OppositeDifferentClass.Match tupleToMatch(final Tuple t) { + try { + return OppositeDifferentClass.Match.newMatch((EReference) t.get(POSITION_A)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected OppositeDifferentClass.Match arrayToMatch(final Object[] match) { + try { + return OppositeDifferentClass.Match.newMatch((EReference) match[POSITION_A]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected OppositeDifferentClass.Match arrayToMatchMutable(final Object[] match) { + try { + return OppositeDifferentClass.Match.newMutableMatch((EReference) match[POSITION_A]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return OppositeDifferentClass.instance(); + } + } + + private OppositeDifferentClass() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static OppositeDifferentClass instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected OppositeDifferentClass.Matcher instantiate(final ViatraQueryEngine engine) { + return OppositeDifferentClass.Matcher.on(engine); + } + + @Override + public OppositeDifferentClass.Matcher instantiate() { + return OppositeDifferentClass.Matcher.create(); + } + + @Override + public OppositeDifferentClass.Match newEmptyMatch() { + return OppositeDifferentClass.Match.newEmptyMatch(); + } + + @Override + public OppositeDifferentClass.Match newMatch(final Object... parameters) { + return OppositeDifferentClass.Match.newMatch((org.eclipse.emf.ecore.EReference) parameters[0]); + } + + /** + * Inner class allowing the singleton instance of {@link JvmGenericType: ecore.OppositeDifferentClass (visibility: PUBLIC, simpleName: OppositeDifferentClass, identifier: ecore.OppositeDifferentClass, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link JvmGenericType: ecore.OppositeDifferentClass (visibility: PUBLIC, simpleName: OppositeDifferentClass, identifier: ecore.OppositeDifferentClass, deprecated: ) (abstract: false, static: false, final: true, packageName: ecore) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final OppositeDifferentClass INSTANCE = new OppositeDifferentClass(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final OppositeDifferentClass.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_a); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "ecore.oppositeDifferentClass"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("a"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_a = body.getOrCreateVariableByName("a"); + PVariable var_b = body.getOrCreateVariableByName("b"); + PVariable var_aContaining = body.getOrCreateVariableByName("aContaining"); + PVariable var_bTarget = body.getOrCreateVariableByName("bTarget"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_a, parameter_a) + )); + // EReference.eOpposite(a,b) + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference", "eOpposite"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + new Equality(body, var__virtual_0_, var_b); + // EReference.eContainingClass(a,aContaining) + new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EStructuralFeature", "eContainingClass"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); + new Equality(body, var__virtual_1_, var_aContaining); + // EReference.eType(b,bTarget) + new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); + PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_b, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "ETypedElement", "eType"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClassifier"))); + new Equality(body, var__virtual_2_, var_bTarget); + // aContaining != bTarget + new Inequality(body, var_aContaining, var_bTarget); + bodies.add(body); + } + { + PAnnotation annotation = new PAnnotation("Constraint"); + annotation.addAttribute("key", Arrays.asList(new Object[] { + new ParameterReference("a") + })); + annotation.addAttribute("severity", "error"); + annotation.addAttribute("message", "error"); + addAnnotation(annotation); + } + return bodies; + } + } +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/ecore.ecore b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/ecore.ecore new file mode 100644 index 00000000..e7dc2768 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/ecore.ecore @@ -0,0 +1,1016 @@ + + + + +

+
+ + +
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + +
+
+ + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + + +
+
+ + +
+ + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + + + + + +
+
+ + + +
+
+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + + +
+
+ + +
+ + + + + + + + + + + + +
+
+ + + + + +
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + + + + + + + + + + + + + +
+
+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + +
+
+ + + + +
+ + + + +
+ + + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + + + +
+
+ + + + + + +
+
+ + + + + +
+
+ + +
+ + + +
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + + + + + +
+
+ + +
+ + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + + + + +
+
+ + +
+ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+ + + + +
+
+ + + + + +
+
+ + +
+ + + + + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+ + + + + +
+
+ + +
+ + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + +
+
+ + + + diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/Domain.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/Domain.xtend new file mode 100644 index 00000000..c8fd435b --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/Domain.xtend @@ -0,0 +1,7 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app + +enum Domain{ + Yakindumm, + Ecore, + Github +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/Main.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/Main.xtend new file mode 100644 index 00000000..dfde6593 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/Main.xtend @@ -0,0 +1,96 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.EMFGraph +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.CsvFileWriter +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.GraphReader +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.validation.ViolationCheck +import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl.YakindummPackageImpl +import java.io.File +import java.util.ArrayList +import org.eclipse.emf.ecore.EPackage +import org.eclipse.emf.ecore.EcorePackage +import org.eclipse.viatra.query.runtime.rete.matcher.ReteEngine +import org.eclipse.emf.ecore.impl.EcorePackageImpl +import org.eclipse.emf.ecore.EReference + +//import yakindumm2.impl.Yakindumm2PackageImpl + +class Main { + var static Domain d = Domain.Yakindumm; + val static String suffix = '.xmi' + val static String OUTPUT_FOLDER = "Inputs/measurement2/yakindu/Alloy/"; + val static String INPUT_FOLDER = "outputs/measurement2/yakindu/Alloy/"; + val static int NUM_RUNS = 1; + + static class RWInformation{ + public var String inputFolder; + public var String outputFolder; + public var int numRuns; + + new(String inputFolder, String outputFolder, int numRuns){ + this.inputFolder = inputFolder; + this.outputFolder = outputFolder; + this.numRuns = numRuns; + } + } + + def static void main(String[] args){ + //init model + var EPackage metamodel; + //init viatra engine for the violation checker + ReteEngine.getClass(); + + if(d == Domain.Yakindumm){ + YakindummPackageImpl.eINSTANCE.eClass; + metamodel = YakindummPackageImpl.eINSTANCE; + }else if (d == Domain.Ecore){ + EcorePackage.eINSTANCE.eClass; + metamodel = EcorePackageImpl.eINSTANCE; + }else if (d == Domain.Github){ + //TODO: Initialize Github Package + } + + + println("Start Reading Models..."); + var reader = new GraphReader(metamodel, suffix); + + val models = new RWInformation(OUTPUT_FOLDER, INPUT_FOLDER, NUM_RUNS); + calculateAllModels(models.inputFolder, models.outputFolder,models.numRuns, reader); + println("finished"); + } + + static def calculateAllModels(String inputFolder, String outputFolder, int numRuns, GraphReader reader){ + (new File(outputFolder)).mkdir(); + for(var i = 1; i <= numRuns; i++){ + val models = new ArrayList(); + models.addAll(reader.readModels(inputFolder + "run" + i)); + for(model : models){ + calculateAndOutputMetrics(model, YakindummPackageImpl.eNAME, outputFolder+model.name+"_run_"+i+".csv"); + } + } + println("output results Ended for: " + outputFolder); + + + } + + static def calculateAndOutputMetrics(EMFGraph model, String metaModel, String fileName){ + //println("evaluating for " + model.name); + model.metaModel = metaModel; + + //remove eGenericType for Ecore domain + if(d == Domain.Ecore){ + var refsToRemove = EcorePackageImpl.eINSTANCE.eAllContents.filter(EReference).filter[ + it.name.equals('eGenericType') || it.name.equals('eGenericSuperTypes') || it.name.equals('eFactoryInstance')|| + it.name.equals('eGenericExceptions') || it.name.equals('references') || it.name.equals('contents'); + ]; + refsToRemove.forEach[model.removeReference(it)]; + } + + var outputs = model.evaluateAllMetrics(); + var violations = ViolationCheck.calculateViolationCounts(model.root, d); + println(violations); + var violationsOutput = newArrayList('violations', violations+''); + outputs.add(violationsOutput); + CsvFileWriter.write(outputs, fileName); + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetric.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetric.xtend new file mode 100644 index 00000000..5e62b586 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetric.xtend @@ -0,0 +1,85 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance.JSDistance +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance.KSDistance +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.PartialInterpretationGraph +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.CsvFileWriter +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.Metric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MultiplexParticipationCoefficientMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.NodeActivityMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.OutDegreeMetric +import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation +import java.io.File +import java.io.FileNotFoundException +import java.io.PrintWriter +import java.util.ArrayList +import java.util.List +import org.eclipse.emf.ecore.util.EcoreUtil +import org.eclipse.viatra.dse.api.Solution + +class PartialInterpretationMetric { + var static KSDistance ks; + var static JSDistance js; + + def static void initPaths(){ + new File("debug/metric/").mkdir(); + new File("debug/metric/trajectories/").mkdir(); + } + + // calculate the metrics for a state + def static void calculateMetric(PartialInterpretation partial, String path, String currentStateId, Integer counter){ + val metrics = new ArrayList(); + metrics.add(new OutDegreeMetric()); + metrics.add(new NodeActivityMetric()); + metrics.add(new MultiplexParticipationCoefficientMetric()); + + //make dir since the folder can be none existing + new File(path).mkdir(); + val filename = path + "/state_"+currentStateId+"-"+counter+".csv"; + val metricCalculator = new PartialInterpretationGraph(partial, metrics, currentStateId); + + CsvFileWriter.write(metricCalculator.evaluateAllMetrics(), filename); + } + + def static void outputTrajectories(PartialInterpretation empty, List solutions){ + for(solution : solutions){ + + //need to copy the empty solution because the transition directly worked on the graph + val emptySolutionCopy = EcoreUtil.copy(empty) + val trajectory = solution.shortestTrajectory; + trajectory.model = emptySolutionCopy + + // state codes that will record the trajectory + val stateCodes = newArrayList() + var counter = 0 + + //transform and record the state codes for each state + while(trajectory.doNextTransformation){ + //println(trajectory.stateCoder.createStateCode) + val stateId = trajectory.stateCoder.createStateCode.toString + val interpretation = trajectory.getModel(); + println(stateId) + //calculate metrics of current state + calculateMetric(interpretation as PartialInterpretation, "debug/metric/output", stateId, counter) + stateCodes.add(stateId) + counter++ + } + + + //output the trajectory + try{ + new File("debug/metric/trajectories/").mkdir(); + val path = "debug/metric/trajectories/trajectory"+trajectory.stateCoder.createStateCode.toString+".csv" + val PrintWriter writer = new PrintWriter(new File(path)) + val output = new StringBuilder + for(stateCode : stateCodes){ + output.append(stateCode+'\n') + } + writer.write(output.toString()) + writer.close() + }catch(FileNotFoundException e) { + e.printStackTrace() + } + } + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetricDistance.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetricDistance.xtend new file mode 100644 index 00000000..697b2639 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetricDistance.xtend @@ -0,0 +1,216 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance.EuclideanDistance +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance.JSDistance +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance.KSDistance +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance.StateData +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.PartialInterpretationGraph +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.RepMetricsReader +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.Metric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MultiplexParticipationCoefficientMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.NodeActivityMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.NodeTypeMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.OutDegreeMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.predictor.LinearModel +import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation +import java.util.ArrayList +import java.util.HashMap +import java.util.List +import java.util.Map +import org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression +import org.eclipse.xtend.lib.annotations.Accessors +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.EdgeTypeMetric + +class PartialInterpretationMetricDistance { + + var KSDistance ks; + var JSDistance js; + var EuclideanDistance ed; + var Map stateAndHistory; + var OLSMultipleLinearRegression regression; + List samples; + var MetricSampleGroup g; + @Accessors(PUBLIC_GETTER) + var LinearModel linearModel; + + + new(Domain d){ + var metrics = RepMetricsReader.read(d); + this.g = metrics; + ks = new KSDistance(g); + js = new JSDistance(g); + ed = new EuclideanDistance(g); + regression = new OLSMultipleLinearRegression(); + regression.noIntercept = false; + stateAndHistory = new HashMap(); + samples = new ArrayList(); + linearModel = new LinearModel(0.01); + } + + def MetricDistanceGroup calculateMetricDistanceKS(PartialInterpretation partial){ + val metrics = new ArrayList(); + metrics.add(new OutDegreeMetric()); + metrics.add(new NodeActivityMetric()); + metrics.add(new MultiplexParticipationCoefficientMetric()); + metrics.add(new NodeTypeMetric()); + val metricCalculator = new PartialInterpretationGraph(partial, metrics, null); + var metricSamples = metricCalculator.evaluateAllMetricsToSamples(); + + var mpc = ks.mpcDistance(metricSamples.mpcSamples); + var na = ks.naDistance(metricSamples.naSamples); + var outDegree = ks.outDegreeDistance(metricSamples.outDegreeSamples); + var nodeType = ks.nodeTypeDistance(metricSamples.nodeTypeSamples); + //var typedOutDegree = ks.typedOutDegreeDistance(metricSamples.typedOutDegreeSamples); + var distance = new MetricDistanceGroup(mpc, na, outDegree, nodeType); + distance.nodeTypeInfo = metricSamples.nodeTypeSamples; + return distance; + } + + def MetricDistanceGroup calculateMetricEuclidean(PartialInterpretation partial){ + val metrics = new ArrayList(); + metrics.add(new OutDegreeMetric()); + metrics.add(new NodeActivityMetric()); + metrics.add(new MultiplexParticipationCoefficientMetric()); + + val metricCalculator = new PartialInterpretationGraph(partial, metrics, null); + var metricSamples = metricCalculator.evaluateAllMetricsToSamples(); + + var mpc = ed.mpcDistance(metricSamples.mpcSamples); + var na = ed.naDistance(metricSamples.naSamples); + var outDegree = ed.outDegreeDistance(metricSamples.outDegreeSamples); + + return new MetricDistanceGroup(mpc, na, outDegree); + } + + def MetricDistanceGroup calculateMetricDistance(PartialInterpretation partial){ + val metrics = new ArrayList(); + metrics.add(new OutDegreeMetric()); + metrics.add(new NodeActivityMetric()); + metrics.add(new MultiplexParticipationCoefficientMetric()); + + val metricCalculator = new PartialInterpretationGraph(partial, metrics, null); + var metricSamples = metricCalculator.evaluateAllMetricsToSamples(); + + var mpc = js.mpcDistance(metricSamples.mpcSamples); + var na = js.naDistance(metricSamples.naSamples); + var outDegree = js.outDegreeDistance(metricSamples.outDegreeSamples); + + return new MetricDistanceGroup(mpc, na, outDegree); + } + + def resetRegression(Object state){ + samples.clear(); + + if(stateAndHistory.containsKey(state)){ + var data = stateAndHistory.get(state); + + var curState = state; + + samples.add(data); + + while(stateAndHistory.containsKey(data.lastState) && data.lastState != curState){ + curState = data.lastState; + data = stateAndHistory.get(data.lastState); + samples.add(data); + } + + if(samples.size == 0){ + println('state: ' + state); + println('last state: ' + data.lastState); + } + } + println("trajectory sample size:" + samples.size) + } + + def feedData(Object state, double[] features, double value, Object lastState){ + var data = new StateData(features, value, lastState); + stateAndHistory.put(state, data); + samples.add(data); + } + + def getPredictionForNextDataSample(double[] features, double value, double[] featuresToPredict){ + if(samples.size <= 4){ + println('OK'); + } + var data = new StateData(features, value, null); + samples.add(data); + + // create training set from current data + var double[][] xSamples = samples.map[it.features]; + var double[] ySamples = samples.map[it.value]; + + + regression.newSampleData(ySamples, xSamples); + var prediction = predict(featuresToPredict); + + //remove the last element just added + samples.remove(samples.size - 1); + return prediction; + } + + def private predict(double[] featuresToPredict){ + var parameters = regression.estimateRegressionParameters(); + // the regression will add an initial column for 1's, the first parameter is constant term + var result = parameters.get(0); + for(var i = 0; i < featuresToPredict.length; i++){ + result += parameters.get(i+1) * featuresToPredict.get(i); + } + return result; + } + + def double[] calculateFeature(int step, int violations){ + var features = newDoubleArrayOfSize(2); + //constant term + features.set(0, 1); //a + features.set(0, Math.sqrt(step) + 30) // b + features.set(1, 1.0 / (step + 30) );// c + + +// features.set(2, violations); +// features.set(3, Math.pow(violations, 2)); + + return features; + } +} + +class MetricDistanceGroup{ + var double mpcDistance; + var double naDistance; + var double outDegreeDistance; + var double nodeTypeDistance; + protected var HashMap nodeTypeInfo; + + new(double mpcDistance, double naDistance, double outDegreeDistance, double nodeTypeDistance){ + this.mpcDistance = mpcDistance; + this.naDistance = naDistance; + this.outDegreeDistance = outDegreeDistance; + this.nodeTypeDistance = nodeTypeDistance; + } + + new(double mpcDistance, double naDistance, double outDegreeDistance){ + this.mpcDistance = mpcDistance; + this.naDistance = naDistance; + this.outDegreeDistance = outDegreeDistance; + } + + def double getNodeTypeDistance(){ + return this.nodeTypeDistance; + } + + def double getMPCDistance(){ + return this.mpcDistance + } + + def double getNADistance(){ + return this.naDistance + } + + def double getOutDegreeDistance(){ + return this.outDegreeDistance + } + + def double getNodeTypePercentage(String typeName){ + return nodeTypeInfo.getOrDefault(typeName, 0.0); + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/CostDistance.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/CostDistance.xtend new file mode 100644 index 00000000..613f0f43 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/CostDistance.xtend @@ -0,0 +1,38 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance + +import java.text.DecimalFormat +import java.util.HashMap +import java.util.List +import org.eclipse.xtend.lib.annotations.Accessors + +abstract class CostDistance { + def abstract double naDistance(List samples); + def abstract double mpcDistance(List samples); + def abstract double outDegreeDistance(List samples); + + def protected pmfFromSamples(double[] samples, DecimalFormat formatter){ + var length = samples.length; + var pmfMap = new HashMap(); + + for(sample : samples){ + pmfMap.put(formatter.format(sample), pmfMap.getOrDefault(formatter.format(sample), 0.0) + 1.0 / length); + } + + return pmfMap; + } +} + +class StateData{ + @Accessors(PUBLIC_GETTER) + var double[] features; + @Accessors(PUBLIC_GETTER) + var double value; + @Accessors(PUBLIC_GETTER) + var Object lastState; + + new(double[] features, double value, Object lastState){ + this.features = features; + this.value = value + this.lastState = lastState; + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/EuclideanDistance.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/EuclideanDistance.xtend new file mode 100644 index 00000000..d6adcc9a --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/EuclideanDistance.xtend @@ -0,0 +1,72 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app.Domain +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io.RepMetricsReader +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup +import com.google.common.collect.Sets +import java.text.DecimalFormat +import java.util.ArrayList +import java.util.HashMap +import java.util.List +import java.util.Map +import java.util.Set + +class EuclideanDistance extends CostDistance{ + var MetricSampleGroup g; + var HashMap mpcPMF; + var HashMap naPMF; + var HashMap outDegreePMF; + var DecimalFormat formatter; + + new(MetricSampleGroup g){ + this.g = g; + + var mpcSamples = g.mpcSamples; + var naSamples = g.naSamples.stream.mapToDouble([it]).toArray(); + var outDegreeSamples = g.outDegreeSamples.stream.mapToDouble([it]).toArray(); + + //needs to format the number to string avoid precision issue + formatter = new DecimalFormat("#0.00000"); + + mpcPMF = pmfFromSamples(mpcSamples, formatter); + naPMF = pmfFromSamples(naSamples, formatter); + outDegreePMF = pmfFromSamples(outDegreeSamples, formatter); + } + + override naDistance(List samples) { + var pmfMap = pmfFromSamples(samples, formatter); + return euclideanDistance(pmfMap, naPMF); + } + + override mpcDistance(List samples) { + var pmfMap = pmfFromSamples(samples, formatter); + return euclideanDistance(pmfMap, mpcPMF); + } + + override outDegreeDistance(List samples) { + var pmfMap = pmfFromSamples(samples, formatter); + return euclideanDistance(pmfMap, outDegreePMF); + } + + + def private euclideanDistance(HashMap pmf1, HashMap pmf2){ + var keys = Sets.union(pmf1.keySet(), pmf2.keySet()); + var pmfList1 = pmfMapToList(pmf1, keys); + var pmfList2 = pmfMapToList(pmf2, keys); + var distance = 0.0; + for(var i = 0; i < pmfList1.size(); i++){ + distance += Math.pow(pmfList1.get(i) + pmfList2.get(i), 2); + } + + return Math.sqrt(distance); + } + + def private pmfMapToList(Map map, Set keys){ + var list = new ArrayList(); + for(key : keys){ + var value = map.getOrDefault(key, 0.0); + list.add(value); + } + return list; + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/JSDistance.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/JSDistance.xtend new file mode 100644 index 00000000..4a0a0dc3 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/JSDistance.xtend @@ -0,0 +1,88 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup +import com.google.common.collect.Sets +import java.text.DecimalFormat +import java.util.HashMap +import java.util.List + +class JSDistance extends CostDistance { + var HashMap mpcPMF; + var HashMap naPMF; + var HashMap outDegreePMF; + var HashMap nodeTypesPMF; + var DecimalFormat formatter; + + new(MetricSampleGroup g){ + var mpcSamples = g.mpcSamples; + var naSamples = g.naSamples.stream.mapToDouble([it]).toArray(); + var outDegreeSamples = g.outDegreeSamples.stream.mapToDouble([it]).toArray(); + + //needs to format the number to string avoid precision issue + formatter = new DecimalFormat("#0.00000"); + + mpcPMF = pmfFromSamples(mpcSamples, formatter); + naPMF = pmfFromSamples(naSamples, formatter); + outDegreePMF = pmfFromSamples(outDegreeSamples, formatter); + nodeTypesPMF = g.nodeTypeSamples; + } + + def private combinePMF(HashMap pmf1, HashMap pmf2){ + var pmfMap = new HashMap(); + + var union = Sets.union(pmf1.keySet(), pmf2.keySet()); + + for(key : union){ + // corresponding to M in JS distance + var value = 1.0/2 * (pmf1.getOrDefault(key, 0.0) + pmf2.getOrDefault(key, 0.0)); + pmfMap.put(key, value); + } + return pmfMap; + } + + def private jsDivergence(HashMap p, HashMap q){ + val m = combinePMF(q, p); + var distance = 1.0/2 * klDivergence(p, m) + 1.0/2 * klDivergence(q, m); + return distance; + } + + def klDivergence(HashMap p, HashMap q){ + var distance = 0.0; + for(key : q.keySet()){ + //need to convert log e to log 2 + if(p.containsKey(key)){ + distance -= p.get(key) * Math.log(q.get(key) / p.get(key)) / Math.log(2); + } + } + return distance; + } + + override double mpcDistance(List samples){ + // map list to array + var map = pmfFromSamples(samples.stream().mapToDouble([it]).toArray(), formatter); + //if the size of array is smaller than 2, ks distance cannot be performed, simply return 1 + if(map.size < 2) return 1; + return jsDivergence(map, mpcPMF); + } + + override double naDistance(List samples){ + // map list to array + var map = pmfFromSamples(samples.stream().mapToDouble([it]).toArray(), formatter); + + //if the size of array is smaller than 2, ks distance cannot be performed, simply return 1 + if(map.size < 2) return 1; + return jsDivergence(map, naPMF); + } + + override double outDegreeDistance(List samples){ + // map list to array + var map = pmfFromSamples(samples.stream().mapToDouble([it]).toArray(), formatter); + //if the size of array is smaller than 2, ks distance cannot be performed, simply return 1 + if(map.size < 2) return 1; + return jsDivergence(map, outDegreePMF); + } + + def nodeTypeDistance(HashMap samples){ + return klDivergence(samples, nodeTypesPMF); + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/KSDistance.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/KSDistance.xtend new file mode 100644 index 00000000..c486a328 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/distance/KSDistance.xtend @@ -0,0 +1,102 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup +import java.util.HashMap +import java.util.HashSet +import java.util.List +import org.apache.commons.math3.stat.inference.KolmogorovSmirnovTest + +class KSDistance extends CostDistance { + var static ksTester = new KolmogorovSmirnovTest(); + var MetricSampleGroup g; + + new(MetricSampleGroup g){ + this.g = g; + } + override double mpcDistance(List samples){ + //if the size of array is smaller than 2, ks distance cannot be performed, simply return 1 + if(samples.size < 2) return 1; + return ksTester.kolmogorovSmirnovStatistic(g.mpcSamples, samples); + } + + override double naDistance(List samples){ + //if the size of array is smaller than 2, ks distance cannot be performed, simply return 1 + if(samples.size < 2) return 1; + return ksTester.kolmogorovSmirnovStatistic(g.naSamples as double[], samples); + } + + override double outDegreeDistance(List samples){ + //if the size of array is smaller than 2, ks distance cannot be performed, simply return 1 + if(samples.size < 2) return 1; + return ksTester.kolmogorovSmirnovStatistic(g.outDegreeSamples, samples); + } + + def double typedOutDegreeDistance(HashMap> map){ + var value = 0.0; + // map list to array + val keySet = new HashSet(map.keySet); + keySet.addAll(g.typedOutDegreeSamples.keySet); + for(key : keySet){ + if(!map.containsKey(key) ){ + value += 1; + }else if(!g.typedOutDegreeSamples.containsKey(key)){ + value += map.get(key).size * 100; + }else{ + var double[] rep = g.typedOutDegreeSamples.get(key).stream().mapToDouble([it|it]).toArray(); + var double[] ins = map.get(key).stream().mapToDouble([it|it]).toArray(); + if((rep.size < 2 || ins.size < 2) ){ + if(rep.size < 2 && rep.containsAll(ins)){ + value += 0; + }else{ + value += 1; + } + }else if(rep.size >= 2 && ins.size >= 2){ + value += ksTester.kolmogorovSmirnovStatistic(rep, ins); + } + } + } + + + return value; + } + + def nodeTypeDistance(HashMap samples){ + var typesDistMap = g.nodeTypeSamples; + var sourceDist = newArrayList(); + var instanceDist = newArrayList(); + + for(key : typesDistMap.keySet()){ + sourceDist.add(typesDistMap.get(key)); + instanceDist.add(samples.getOrDefault(key, 0.0)); + } + + return ks_distance_two_dist(sourceDist, instanceDist); + } + + def edgeTypeDistance(HashMap samples){ + var typesDistMap = g.edgeTypeSamples; + var sourceDist = newArrayList(); + var instanceDist = newArrayList(); + + for(key : typesDistMap.keySet()){ + sourceDist.add(typesDistMap.get(key)); + instanceDist.add(samples.getOrDefault(key, 0.0)); + } + + return ks_distance_two_dist(sourceDist, instanceDist); + } + + def double ks_distance_two_dist(List dist1, List dist2){ + // Since we already know the pdf, we compute the ks-test manully + var ksStatistics = 0.0; + var sum1 = 0.0; + var sum2 = 0.0; + for(var i = 0; i < dist1.size(); i++){ + sum1 += dist1.get(i); + sum2 += dist2.get(i); + + ksStatistics = Math.max(ksStatistics, Math.abs(sum1 - sum2)); + } + return ksStatistics; + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/EMFGraph.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/EMFGraph.xtend new file mode 100644 index 00000000..8fa29fe6 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/EMFGraph.xtend @@ -0,0 +1,124 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.Metric +import java.util.ArrayList +import java.util.HashSet +import java.util.List +import org.eclipse.emf.common.util.EList +import org.eclipse.emf.ecore.EObject +import org.eclipse.emf.ecore.EReference +import org.eclipse.xtend.lib.annotations.Accessors + +class EMFGraph extends Graph{ + @Accessors(PUBLIC_GETTER) + var EObject root; + + def void init (EObject root, List metrics, String name, List referenceTypes){ + val otherContents = root.eAllContents.toList(); + this.root = root; + otherContents.add(root); + init(otherContents, metrics, name, referenceTypes); + } + + /** + * init the graph with all nodes and reference types in the meta model + * @param objects: objects in the instance model (exclude root) + * @param metrics: metrics to be evaluated + * @param name: name of the instance model + * @param ReferenceTypes: reference types defined in the meta model + */ + def void init(List objects, List metrics, String name, List referenceTypes){ + objects.forEach[it| + // TODO: Maybe want to consider all the super types as well + var types = new HashSet(); + types.add(it.eClass.name); + statistic.addNodeWithAllTypes(it, types); + ] + + referenceTypes.forEach[it| + // Only consider the edges that are not derived to preserve the statistical property + if(!it.derived){ + statistic.addEdgeType(it.name); + } + ]; + + objects.forEach[source| + source.eClass.EAllReferences.forEach[r| + //many references + if(r.isMany){ + source.getNeighbours(r).forEach[target| + addEdge(source, target, r); + ] + }else{ + //single references + val target = source.eGet(r) as EObject; + addEdge(source, target, r); + } + ] + ] + + this.metrics = metrics; + this.name = name; + } + + def void removeReference(EReference r){ + if (statistic.containsEdgeType(r.name)){ + statistic.removeReference(r.name, r.containment); + } + } + + /** + * Set basic information for the output + */ + override setBasicInformation(ArrayList> output){ + val metaInfo = new ArrayList(); + metaInfo.add(META_MODEL_HEADER); + metaInfo.add(this.metaModel); + + val edgeInfo = new ArrayList(); + edgeInfo.add(NUM_EDGE_TYPE_HEADER); + edgeInfo.add(this.statistic.allTypes.size()+""); + + val nodeInfo = new ArrayList(); + nodeInfo.add(NUM_NODE_HEADER); + nodeInfo.add(this.statistic.allNodes.size()+""); + + val stateInfo = new ArrayList(); + stateInfo.add(STATE_ID_HEADER); + stateInfo.add(this.name); + + + output.add(metaInfo); + output.add(edgeInfo); + output.add(nodeInfo); + output.add(stateInfo); + } + + def EList getNeighbours(EObject o, EReference r){ + return (o.eGet(r, true) as EList); + } + + def addEdge(EObject source, EObject target, EReference r){ + //Only add the edge if the reference is not derived to preserve the statistical property + if(target !== null && r !== null && !r.derived){ + statistic.addEdge(source, target, r.name); + } + } + + override GraphStatistic getStatistic(){ + return this.statistic; + } + + override String getName(){ + return this.name; + } + + def void setMetaModel(String model){ + this.metaModel = model; + } + + def String getMetaModel(){ + return this.metaModel; + } + +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/Graph.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/Graph.xtend new file mode 100644 index 00000000..6b400b0d --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/Graph.xtend @@ -0,0 +1,71 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.Metric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MultiplexParticipationCoefficientMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.NodeActivityMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.OutDegreeMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.TypedOutDegree +import java.util.ArrayList +import java.util.HashMap +import java.util.List +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.NodeTypeMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.EdgeTypeMetric + +abstract class Graph { + + protected static val String META_MODEL_HEADER = "Meta Mode" + protected static val String NUM_NODE_HEADER = "Number Of Nodes"; + protected static val String NUM_EDGE_TYPE_HEADER = "Number of Edge types"; + protected static val String STATE_ID_HEADER = "State Id"; + + protected val statistic = new GraphStatistic(); + protected var List metrics; + protected var String name = ""; + protected var String metaModel = ""; + + /** + * evaluate all metrics for this model + * return the result as a two dimentional list + */ + def ArrayList> evaluateAllMetrics(){ + val result = new ArrayList>(); + setBasicInformation(result); + + for(metric : this.metrics){ + val datas = metric.evaluate(this.statistic); + for(row : datas){ + result.add(new ArrayList(row)); + } + } + return result; + } + + def MetricSampleGroup evaluateAllMetricsToSamples(){ + var sample = new MetricSampleGroup(); + + for(metric : this.metrics){ + if(metric instanceof MultiplexParticipationCoefficientMetric){ + sample.mpcSamples = metric.evaluateSamples(this.statistic) as ArrayList; + }else if(metric instanceof NodeActivityMetric){ + sample.naSamples = metric.evaluateSamples(this.statistic) as ArrayList; + }else if(metric instanceof OutDegreeMetric){ + sample.outDegreeSamples = metric.evaluateSamples(this.statistic) as ArrayList; + }else if(metric instanceof TypedOutDegree){ + sample.typedOutDegreeSamples = metric.evaluateSamples(this.statistic) as HashMap>; + }else if(metric instanceof NodeTypeMetric){ + sample.nodeTypeSamples = metric.evaluateSamples(this.statistic) as HashMap; + }else if (metric instanceof EdgeTypeMetric){ + sample.edgeTypeSamples = metric.evaluateSamples(this.statistic) as HashMap; + } + } + + return sample; + } + + def void setBasicInformation(ArrayList> result); + + def GraphStatistic getStatistic(); + + def String getName(); +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/GraphStatistic.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/GraphStatistic.xtend new file mode 100644 index 00000000..31788bb2 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/GraphStatistic.xtend @@ -0,0 +1,194 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph + +import com.google.common.collect.ArrayListMultimap +import com.google.common.collect.Multimap +import java.util.HashMap +import java.util.HashSet +import java.util.List +import java.util.Map +import java.util.Set +import org.eclipse.emf.ecore.EObject +import org.eclipse.emf.ecore.EReference + +class GraphStatistic { + val incomingEdges = new HashMap>; + val outgoingEdges = new HashMap>; + + val edgeTypes = new HashSet(); + val nodeToType = new HashMap>(); + + /** + * Add an edge type to to the graph + * @param type: type to add + */ + def void addEdgeType(String type){ + if(edgeTypes.contains(type)){ + return; + } + + edgeTypes.add(type); + incomingEdges.put(type, ArrayListMultimap.create()); + outgoingEdges.put(type, ArrayListMultimap.create()); + } + + /** + * Add a node to the graph with one type in its type hierarchy + * @param node: node to add + */ + def void addNodeWithType(EObject n, String Type){ + var types = nodeToType.getOrDefault(n, new HashSet()); + types.add(Type); + nodeToType.put(n, types); + } + + def boolean containsNode(EObject o){ + return nodeToType.containsKey(o); + } + + def Set getTypesForNode(EObject o){ + return nodeToType.getOrDefault(o, new HashSet()); + } + + def void overwriteCurrentType(EObject o, String type){ + var typeSet = nodeToType.getOrDefault(o, new HashSet()); + + // clear current types + typeSet.clear(); + typeSet.add(type); + nodeToType.put(o, typeSet); + } + + /** + * Add a node to the graph with all types in its type hierarchy + */ + def void addNodeWithAllTypes(EObject n, Set types){ + nodeToType.put(n, types); + } + + /** + * Add an edge to the graph + * @param source: source node + * @param target: target node + * @param type: type of the reference + */ + def void addEdge(EObject source, EObject target, String type){ + outgoingEdges.get(type).put(source, target); + incomingEdges.get(type).put(target, source); + } + + /** + * check if this graph contains a specific edge type + */ + def boolean containsEdgeType(String typeName){ + if(outgoingEdges.containsKey(typeName) && incomingEdges.containsKey(typeName)){ + return true; + } + return false; + } + + /** + * remove references from the statistics, potentially remove the nodes associated with it + * @Param name: name of the reference + * @Param isContainment: if true then the corresponding nodes on the incoming side will also be removed + */ + def removeReference(String name, boolean isContainment){ + if(!edgeTypes.contains(name)){ + return; + } + + edgeTypes.remove(name); + var incomingSet = incomingEdges.remove(name); + outgoingEdges.remove(name); + + // if the reference is not a containment, then removing the reference is enough + if(!isContainment){ + return; + } + + // else remove all corresponding nodes + val nodesToRemove = incomingSet.keySet(); + + //remove nodes from node sets + nodesToRemove.forEach[nodeToType.remove(it)]; + + val removeForMultimap = [Multimap refMap| + nodesToRemove.forEach[refMap.removeAll(it)]; + var values = refMap.values() + //remove the values from the list is equavalent to remove it in the multimap + values.removeAll(nodesToRemove); + return; + ]; + + //remove nodes from all other references on incomingEdges + incomingEdges.values.forEach(removeForMultimap); + outgoingEdges.values.forEach(removeForMultimap); + } + + /** + * calculate the out degree for an object + */ + def int outDegree(EObject o){ + var count = 0; + + for (String type : edgeTypes){ + count += outgoingEdges.get(type).get(o).size(); + } + return count; + } + + /** + * calculate the in degree of an object + */ + def int inDegree(EObject o){ + var count = 0; + + for (String type : edgeTypes){ + count += incomingEdges.get(type).get(o).size(); + } + return count; + } + + /** + * calculate the dimentional degree of a node + */ + def int dimentionalDegree(EObject o, String type){ + return incomingEdges.get(type).get(o).size() + outgoingEdges.get(type).get(o).size(); + } + + /** + * calculate the number of edge types for a given node. + */ + def int numOfEdgeTypes(EObject o){ + var count = 0; + + for(String type : edgeTypes){ + if(dimentionalDegree(o, type) > 0){ + count++; + } + } + + return count; + } + + def List getAllTypes(){ + return edgeTypes.toList(); + } + + def Map> getNodeToTypesMap(){ + return nodeToType; + } + + def List getAllNodes(){ + return nodeToType.keySet().toList(); + } + + def HashMap> getOutgoingEdges(){ + return outgoingEdges; + } + + def HashMap> incomingEdges(){ + return incomingEdges; + } + +} + diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend new file mode 100644 index 00000000..a2934eb9 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend @@ -0,0 +1,134 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.Metric +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type +import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDefinition +import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BinaryElementRelationLink +import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation +import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.impl.PartialComplexTypeInterpretationImpl +import java.util.ArrayList +import java.util.List + +class PartialInterpretationGraph extends Graph{ + val typeToExclude = "undefinedpart"; + val classSuffix = " class"; + + /** + * Define a new PartialInterpretationGraph by parse every element from a PartialInterpretation + */ + new(PartialInterpretation partial, List metrics, String name){ + //the edge types are defined in terms of RelationDeclaration + partial.problem.relations.filter(RelationDeclaration).forEach[ + //only need the name of the reference type (remove everything with and after "reference") + var n = it.name.split(" ").get(0); + this.statistic.addEdgeType(n); + ] + // add all elements + val typeInterpretations = getTypes(partial); + for(type : typeInterpretations){ + //Only consider the most concrete class + if(isConcreteType(type.interpretationOf)){ + var typeName = type.interpretationOf.name.replace(classSuffix, ''); + for(node : type.elements){ + if(!this.statistic.containsNode(node)){ + this.statistic.addNodeWithType(node, typeName); + }else{ + // if the current type of the node is a super type of the type to check, + // substitute the current type with the new type + var currentType = statistic.getTypesForNode(node).get(0); + if(isSuperType(currentType, type.interpretationOf)){ + statistic.overwriteCurrentType(node, typeName); + } + } + } + } + } + + for(relationInterpretation : partial.partialrelationinterpretation) { + //only need the name of the reference type (remove everything with and after "reference") + val type = relationInterpretation.interpretationOf.name.split(" ").get(0); + for(edge : relationInterpretation.relationlinks.filter(BinaryElementRelationLink)){ + statistic.addEdge(edge.param1, edge.param2, type); + } + } + + this.name = name; + this.metrics = metrics; + } + + /** + * recursively check if a type is the super type of another + */ + def boolean isSuperType(String typeName, Type subtypeToCheck){ + var superTypes = subtypeToCheck.supertypes; + if(superTypes.size == 0){ + return false; + }else if(subtypeToCheck.supertypes.map[it.name.replace(classSuffix, '')].contains(typeName)){ + return true; + }else{ + for(superType : superTypes){ + if(isSuperType(typeName, superType)){ + return true; + } + } + return false; + } + } + + /** + * Check if a Type object is the class that we want to consider + * A type object is to be considered if it satisfy one of the following: + * 1. if it is not abstract + * 2. if it is abstract but has a subclass of type TypeDefinition (This means the generation is + * started with nodes in this type) + */ + def boolean isConcreteType(Type t){ + if(!t.isAbstract || t.subtypes.findFirst[it instanceof TypeDefinition] !== null){ + return true; + } + return false; + } + + /** + * Set basic information for the output + */ + override setBasicInformation(ArrayList> output){ + val metaInfo = new ArrayList(); + metaInfo.add(META_MODEL_HEADER); + metaInfo.add(this.metaModel); + + val edgeInfo = new ArrayList(); + edgeInfo.add(NUM_EDGE_TYPE_HEADER); + edgeInfo.add(this.statistic.allTypes.size()+""); + + val nodeInfo = new ArrayList(); + nodeInfo.add(NUM_NODE_HEADER); + nodeInfo.add(this.statistic.allNodes.size()+""); + + val stateInfo = new ArrayList(); + stateInfo.add(STATE_ID_HEADER); + stateInfo.add(this.name); + + output.add(metaInfo); + output.add(edgeInfo); + output.add(nodeInfo); + output.add(stateInfo); + } + + private def getTypes(PartialInterpretation partial){ + //only the complex type interpretations are the ones defined in meta model + //do not care about undefined types as it will be included in the class type + return partial.partialtypeinterpratation.filter(PartialComplexTypeInterpretationImpl) + .filter[!it.interpretationOf.name.toLowerCase.contains(typeToExclude)]; + } + + override getStatistic() { + throw new UnsupportedOperationException("TODO: auto-generated method stub") + } + + override getName() { + return name; + } + +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/CsvFileWriter.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/CsvFileWriter.xtend new file mode 100644 index 00000000..00b38d90 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/CsvFileWriter.xtend @@ -0,0 +1,52 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io; + +import java.io.File +import java.io.FileNotFoundException +import java.io.FileOutputStream +import java.io.PrintWriter +import java.util.ArrayList +import java.util.List + +class CsvFileWriter { + + def static void write(ArrayList> datas, String uri) { + if(datas.size() <= 0) { + return; + } + val PrintWriter writer = new PrintWriter(new File(uri)); + output(writer, datas, uri); + } + + def static void append(ArrayList> datas, String uri) { + if(datas.size() <= 0) { + return; + } + val PrintWriter writer = new PrintWriter(new FileOutputStream(new File(uri), true)); + output(writer, datas, uri); + } + + + def private static void output(PrintWriter writer, ArrayList> datas, String uri) { + //println("Output csv for " + uri); + try { + + val output = new StringBuilder; + for(List datarow : datas){ + for(var i = 0; i < datarow.size() - 1; i++){ + output.append(datarow.get(i) + ','); + } + + if(datarow.size >= 1){ + output.append(datarow.get(datarow.size() - 1)); + output.append('\n'); + } + } + + writer.write(output.toString()); + writer.close(); + //println("Output csv finished"); + }catch(FileNotFoundException e) { + e.printStackTrace(); + } + } +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend new file mode 100644 index 00000000..053e0da3 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend @@ -0,0 +1,112 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io; + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.EMFGraph +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.EdgeTypeMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.Metric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MultiplexParticipationCoefficientMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.NodeActivityMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.NodeTypeMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.OutDegreeMetric +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.TypedOutDegree +import java.io.File +import java.io.FileNotFoundException +import java.util.ArrayList +import java.util.List +import org.eclipse.emf.common.util.URI +import org.eclipse.emf.ecore.EObject +import org.eclipse.emf.ecore.EPackage +import org.eclipse.emf.ecore.EReference +import org.eclipse.emf.ecore.resource.Resource +import org.eclipse.emf.ecore.resource.ResourceSet +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl +import org.eclipse.emf.ecore.EGenericType +import org.eclipse.emf.ecore.EStructuralFeature +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.TypedClusteringCoefficientMetric + +class GraphReader{ + val ResourceSet resSet = new ResourceSetImpl(); + val referenceTypes = new ArrayList(); + var String suffix; + + new(EPackage metaModel, String suffix) { + Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("*",new XMIResourceFactoryImpl) + this.suffix = suffix; + + //find all reference types in the meta model + metaModel.eAllContents.forEach[ + if(it instanceof EReference){ + referenceTypes.add(it); + } + ] + } + + def List readModels(String path){ + val dir = new File(path); + if(!dir.isDirectory){ + throw new Exception("expecting a directory"); + } + + val graphs = new ArrayList(); + + val metrics = new ArrayList(); + metrics.add(new OutDegreeMetric()); + metrics.add(new NodeActivityMetric()); + metrics.add(new MultiplexParticipationCoefficientMetric()); + metrics.add(new TypedOutDegree()); + metrics.add(new NodeTypeMetric()); + metrics.add(new EdgeTypeMetric()); + var count = 1 + //check all files in the directory with suffix + for(String name : dir.list.filter[it| it.endsWith(suffix)]){ + val file = new File(name); + val roots = readModel(EObject, path, file.name); + //add a list of metrics + val g = new EMFGraph(); + for(root : roots){ + g.init(root, metrics, name.replaceFirst(suffix, ""), referenceTypes); + } + + count ++; + graphs.add(g); + } + + return graphs; + } + + def EMFGraph readModel(String path, String filename){ + val metrics = new ArrayList(); + metrics.add(new OutDegreeMetric()); + metrics.add(new NodeActivityMetric()); + metrics.add(new MultiplexParticipationCoefficientMetric()); + metrics.add(new TypedOutDegree()); + metrics.add(new NodeTypeMetric()); + metrics.add(new EdgeTypeMetric()); + + val file = new File(filename); + val roots = readModel(EObject, path, file.name); + //add a list of metrics + val g = new EMFGraph(); + for(root : roots){ + g.init(root, metrics, filename.replaceFirst(suffix, ""), referenceTypes); + } + return g + } + + def List readModel(Class type, String path, String name) { + try { + val resource = resSet.getResource(getURI(path, name),true); + if(resource === null) throw new FileNotFoundException(getURI(path, name).toString) + else { + return resource.contents as List + } + } catch(Exception e) { + e.printStackTrace(); + throw new Exception(getURI(path, name).toString()); + } + } + + def static getURI(String path, String name) { + URI.createFileURI(path + "/" + name) + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/RepMetricsReader.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/RepMetricsReader.xtend new file mode 100644 index 00000000..2e7be586 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/RepMetricsReader.xtend @@ -0,0 +1,100 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app.Domain +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup +import github.impl.GithubPackageImpl +import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl.YakindummPackageImpl +import java.util.HashMap +import org.eclipse.emf.ecore.EReference +import org.eclipse.emf.ecore.impl.EcorePackageImpl + +/** + * Read the sample of the distribution of a metric provided the csv file of the metric + */ +class RepMetricsReader { + static var Domain domain; + static def read(Domain d){ + var GraphReader reader; + if(d == Domain.Yakindumm){ + reader = new GraphReader(YakindummPackageImpl.eINSTANCE, '.xmi'); + }else if (d == Domain.Ecore){ + reader = new GraphReader(EcorePackageImpl.eINSTANCE, '.ecore'); + }else if (d == Domain.Github){ + reader = new GraphReader(GithubPackageImpl.eINSTANCE, '.githubmodel') + } + + domain = d; + + var domainRepPath = DataName.REP_PATH + d.name + '/'; + var rep = new MetricSampleGroup() + var out_d = readMetrics(reader, domainRepPath + DataName.OUT_D_REP); + var mpc = readMetrics(reader, domainRepPath + DataName.MPC_REP); + rep.mpcSamples = mpc.mpcSamples; + rep.outDegreeSamples = out_d.outDegreeSamples; + rep.naSamples = readMetrics(reader, domainRepPath + DataName.NA_REP).naSamples; + rep.typedOutDegreeSamples = out_d.typedOutDegreeSamples; + rep.edgeTypeSamples = mpc.edgeTypeSamples; + + //TODO: Parameterize the prior node distribution + var nodeTypeSamples = new HashMap(); + if(d == Domain.Yakindumm){ + nodeTypeSamples.put('Entry', 0.04257802080554814); + nodeTypeSamples.put('Choice', 0.1267671379034409); + nodeTypeSamples.put('State', 0.1596092291277674); + nodeTypeSamples.put('Transition', 0.6138636969858629); + nodeTypeSamples.put('Statechart', 0.010136036276340358); + nodeTypeSamples.put('Region', 0.04467858095492131); + nodeTypeSamples.put('Exit', 0.0018338223526273673); + nodeTypeSamples.put('FinalState', 0.0005334755934915977); + }else if(d ==Domain.Ecore){ + nodeTypeSamples.put('EAttribute', 0.23539778449144008); + nodeTypeSamples.put('EClass', 0.33081570996978854); + nodeTypeSamples.put('EReference', 0.30996978851963747); + nodeTypeSamples.put('EPackage', 0.012789526686807653); + nodeTypeSamples.put('EAnnotation', 0.002517623363544813); + nodeTypeSamples.put('EEnumLiteral', 0.07275931520644502); + nodeTypeSamples.put('EEnum', 0.013645518630412891); + nodeTypeSamples.put('EDataType', 0.004028197381671702); + nodeTypeSamples.put('EParameter', 0.005941591137965764); + nodeTypeSamples.put('EGenericType', 0.002014098690835851); + nodeTypeSamples.put('EOperation', 0.009415911379657605); + nodeTypeSamples.put('ETypeParameter', 0.0007049345417925478); + }else if (d == Domain.Github){ + nodeTypeSamples.put('Project', 0.012636538873420432); + nodeTypeSamples.put('Commit', 0.5525808524309276); + nodeTypeSamples.put('User', 0.05847076461769116); + nodeTypeSamples.put('Issue', 0.12743628185907047); + nodeTypeSamples.put('PullRequest', 0.07560505461554937); + nodeTypeSamples.put('IssueEvent', 0.17327050760334123); + } + + + + rep.nodeTypeSamples = nodeTypeSamples; + return rep; + } + + /** + * Read representative model + */ + private static def readMetrics(GraphReader r, String path){ + val model = r.readModels(path).head; + if(domain == Domain.Ecore){ + var refsToRemove = EcorePackageImpl.eINSTANCE.eAllContents.filter(EReference).filter[ + it.name.equals('eGenericType') || it.name.equals('eGenericSuperTypes') || it.name.equals('eFactoryInstance') || + it.name.equals('eGenericExceptions') || it.name.equals('references') || it.name.equals('contents'); + ]; + refsToRemove.forEach[model.removeReference(it)]; + } + return model.evaluateAllMetricsToSamples(); + } + +} + +class DataName{ + public static val REP_PATH = 'data/'; + public static val MPC_REP = 'mpc_rep'; + public static val NA_REP = 'na_rep'; + public static val OUT_D_REP = 'out_d_rep'; +} + diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/EdgeTypeMetric.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/EdgeTypeMetric.xtend new file mode 100644 index 00000000..0c0fe3b8 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/EdgeTypeMetric.xtend @@ -0,0 +1,41 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.GraphStatistic +import java.util.ArrayList +import java.util.HashMap + +class EdgeTypeMetric extends Metric { + + override evaluate(GraphStatistic g) { + var map = evaluateSamples(g) as HashMap; + var output = new ArrayList(); + output.add(newArrayList('Edge Type')); + + var keys = map.keySet; + var values = newArrayList(); + for(key : keys){ + values.add(map.get(key)+''); + } + + output.add(keys); + output.add(values); + + return output; + } + + override evaluateSamples(GraphStatistic g) { + val map = new HashMap(); + var outgoingEdges = g.outgoingEdges; + + //get the total number of edges + val edgeCount = outgoingEdges.values.fold(0, [r, t| r + t.asMap.values.fold(0, [r1, t1| r1 + t1.size])]) as double; + outgoingEdges.forEach[k, v| + var value = v.asMap.values.fold(0, [r, t| r + t.size]) / edgeCount; + map.put(k, value); + ] + + + return map; + } + +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/Metric.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/Metric.xtend new file mode 100644 index 00000000..cb242a5b --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/Metric.xtend @@ -0,0 +1,8 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.GraphStatistic + +abstract class Metric { + abstract def String[][] evaluate(GraphStatistic g); + abstract def Object evaluateSamples(GraphStatistic g); +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/MetricSampleGroup.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/MetricSampleGroup.xtend new file mode 100644 index 00000000..4e25bb86 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/MetricSampleGroup.xtend @@ -0,0 +1,13 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics + +import java.util.HashMap +import java.util.List + +class MetricSampleGroup{ + public var List mpcSamples; + public var List naSamples; + public var List outDegreeSamples; + public var HashMap> typedOutDegreeSamples; + public var HashMap nodeTypeSamples; + public var HashMap edgeTypeSamples; +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/MultiplexParticipationCoefficientMetric.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/MultiplexParticipationCoefficientMetric.xtend new file mode 100644 index 00000000..eafa49b2 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/MultiplexParticipationCoefficientMetric.xtend @@ -0,0 +1,80 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.GraphStatistic +import java.text.DecimalFormat +import java.util.ArrayList +import java.util.HashMap +import org.eclipse.emf.ecore.EObject + +class MultiplexParticipationCoefficientMetric extends Metric { + public static val countName = "MPCCount"; + public static val valueName = "MPCValue"; + val formatter = new DecimalFormat("#0.00000"); + + override evaluate(GraphStatistic g) { + //because the precision issue of double, we translate double values into String to be the key + + + //get number of different types + val typeCounts = g.allTypes.size; + val map = new HashMap(); + //calculate the metric distribution + g.allNodes.forEach[n| + var coef = calculateMPC(n, g, typeCounts); + + //format number to String + val value = formatter.format(coef); + if(!map.containsKey(value)){ + map.put(value, 1); + }else{ + map.put(value, map.get(value) + 1); + } + + ] + + //convert it into a 2 dimentional array + val String[][] datas = newArrayOfSize(2, map.size+1); + datas.get(0).set(0, valueName); + datas.get(1).set(0, countName) + var count = 1; + for(entry : map.entrySet.sortBy[it.key]){ + datas.get(0).set(count, entry.key+""); + datas.get(1).set(count, entry.value+""); + count++; + } + + return datas; + } + + override evaluateSamples(GraphStatistic g){ + val samples = new ArrayList(); + val typeCounts = g.allTypes.size; + //calculate the metric distribution + g.allNodes.forEach[ + samples.add(calculateMPC(it, g, typeCounts)); + ] + + return samples; + } + + def double calculateMPC(EObject n, GraphStatistic g, int typeCounts){ + val edgeCounts = g.outDegree(n) + g.inDegree(n); + + var coef = 0.0; + + for(type : g.allTypes){ + val degree = g.dimentionalDegree(n, type) as double; + coef += Math.pow(degree / edgeCounts, 2); + } + coef = 1 - coef; + coef = coef * typeCounts / (typeCounts-1); + + //Consider the case that either typeCounts-1 or the edgeCounts could be 0 in some situation + //in this case the metric should be evaluated to 0 + if(Double.isNaN(coef)){ + coef = 0; + } + + return Double.parseDouble(formatter.format(coef)); + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/NodeActivityMetric.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/NodeActivityMetric.xtend new file mode 100644 index 00000000..fbf06c47 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/NodeActivityMetric.xtend @@ -0,0 +1,49 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.GraphStatistic +import java.util.ArrayList +import java.util.HashMap + +class NodeActivityMetric extends Metric { + public static val countName = "NACount"; + public static val valueName = "NAValue"; + + override evaluate(GraphStatistic g) { + val map = new HashMap(); + + //calculate the metric distribution + g.allNodes.forEach[ + val value = g.numOfEdgeTypes(it); + if(!map.containsKey(value)){ + map.put(value, 1); + }else{ + map.put(value, map.get(value) + 1); + } + ] + + //convert it into a 2 dimentional array + val String[][] datas = newArrayOfSize(2, map.size+1); + datas.get(0).set(0, valueName); + datas.get(1).set(0, countName) + + var count = 1; + for(entry : map.entrySet.sortBy[it.key]){ + datas.get(0).set(count, entry.key+""); + datas.get(1).set(count, entry.value+""); + count++; + } + + return datas; + } + + override evaluateSamples(GraphStatistic g){ + val samples = new ArrayList(); + + //calculate the metric distribution + g.allNodes.forEach[ + samples.add(g.numOfEdgeTypes(it) as double); + ] + + return samples; + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/NodeTypeMetric.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/NodeTypeMetric.xtend new file mode 100644 index 00000000..7cec2513 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/NodeTypeMetric.xtend @@ -0,0 +1,42 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.GraphStatistic +import java.util.ArrayList +import java.util.HashMap + +class NodeTypeMetric extends Metric { + + + override evaluate(GraphStatistic g) { + var map = evaluateSamples(g) as HashMap; + var output = new ArrayList(); + output.add(newArrayList('Node Type')); + var keys = map.keySet; + var values = newArrayList(); + + for(key : keys){ + values.add(map.get(key)+''); + } + + output.add(keys); + output.add(values); + + return output; + } + + override evaluateSamples(GraphStatistic g) { + var map = new HashMap(); + var nodes = g.allNodes; + var single = 1.0 / nodes.size(); + var nodeToType = g.nodeToTypesMap; + for(node : nodes){ + for(cl : nodeToType.get(node)){ + var value = map.getOrDefault(cl, 0.0); + map.put(cl, value + single); + } + } + + return map; + } + +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/OutDegreeMetric.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/OutDegreeMetric.xtend new file mode 100644 index 00000000..55046b14 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/OutDegreeMetric.xtend @@ -0,0 +1,49 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.GraphStatistic +import java.util.ArrayList +import java.util.HashMap + +class OutDegreeMetric extends Metric { + public static val countName = "OutDegreeCount"; + public static val valueName = "OutDegreeValue"; + + override evaluate(GraphStatistic g) { + val map = new HashMap(); + + //calculate the metric distribution + g.allNodes.forEach[ + val value = g.outDegree(it); + if(!map.containsKey(value)){ + map.put(value, 1); + }else{ + map.put(value, map.get(value) + 1); + } + ] + + //convert it into a 2 dimentional array + val String[][] datas = newArrayOfSize(2, map.size+1); + datas.get(0).set(0, valueName); + datas.get(1).set(0, countName) + var count = 1; + for(entry : map.entrySet.sortBy[it.key]){ + datas.get(0).set(count, entry.key+""); + datas.get(1).set(count, entry.value+""); + count++; + } + + return datas; + } + + override evaluateSamples(GraphStatistic g){ + val samples = new ArrayList(); + + //calculate the metric distribution + g.allNodes.forEach[ + samples.add(g.outDegree(it) as double); + ] + + return samples; + } + +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/TypedClusteringCoefficientMetric.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/TypedClusteringCoefficientMetric.xtend new file mode 100644 index 00000000..0b6d61c6 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/TypedClusteringCoefficientMetric.xtend @@ -0,0 +1,99 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.GraphStatistic +import java.text.DecimalFormat +import java.util.ArrayList +import java.util.HashMap +import java.util.HashSet +import org.eclipse.emf.ecore.EObject + +class TypedClusteringCoefficientMetric extends Metric { + public static val countName = "TCCCount"; + public static val valueName = "TCCValue"; + val formatter = new DecimalFormat("#0.00000"); + + override evaluate(GraphStatistic g) { + //because the precision issue of double, we translate double values into String to be the key + + val map = new HashMap(); + //calculate the metric distribution + g.allNodes.forEach[n| + var coef = calculateTCC1(n, g); + if(coef > 0){ + println(n); + } + //format number to String + val value = formatter.format(coef); + if(!map.containsKey(value)){ + map.put(value, 1); + }else{ + map.put(value, map.get(value) + 1); + } + + ] + + //convert it into a 2 dimentional array + val String[][] datas = newArrayOfSize(2, map.size+1); + datas.get(0).set(0, valueName); + datas.get(1).set(0, countName) + var count = 1; + for(entry : map.entrySet.sortBy[it.key]){ + datas.get(0).set(count, entry.key+""); + datas.get(1).set(count, entry.value+""); + count++; + } + + return datas; + } + + override evaluateSamples(GraphStatistic g){ + val samples = new ArrayList(); + //calculate the metric distribution + g.allNodes.forEach[ + samples.add(calculateTCC1(it, g)); + ] + + return samples; + } + + /** + * Compute TCC1 metric for node n + */ + def double calculateTCC1(EObject n, GraphStatistic g){ + var wedges = 0; + var triangles = 0; + + for(type1 : g.allTypes){ + val typed1RelatedOfN = new HashSet(g.outgoingEdges.get(type1).get(n)); + val type1EdgeSourceNodesOfN = new HashSet(g.incomingEdges.get(type1).get(n)); + + typed1RelatedOfN.addAll(type1EdgeSourceNodesOfN); + + + + // number of wedges + val d = typed1RelatedOfN.size + wedges += d * (d-1) // we will also count each closed triangle twice + + // pairs of neighbors + for (n1: typed1RelatedOfN) { + for (n2: typed1RelatedOfN) { + for(type2 : g.allTypes){ + if ((type1 != type2) && + (g.outgoingEdges.get(type2).containsEntry(n1, n2) || + g.outgoingEdges.get(type2).containsEntry(n2, n1) + )) { + triangles++ + } + } + } + } + } + + if (wedges == 0.0) { + return 0.0 + } else { + return (triangles as double)/wedges + } + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/TypedOutDegree.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/TypedOutDegree.xtend new file mode 100644 index 00000000..3b5dbcc5 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/metrics/TypedOutDegree.xtend @@ -0,0 +1,60 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.graph.GraphStatistic +import java.util.ArrayList +import java.util.HashMap +import java.util.List + +class TypedOutDegree extends Metric{ + + def private calculateMetric(GraphStatistic g){ + var outgoingEdges = g.outgoingEdges; + //record metric as a list of samples for each node type / edge type pair + var metric = new HashMap>(); + var nodeToTypes = g.nodeToTypesMap; + + for(edgeType : outgoingEdges.keySet){ + for(node : outgoingEdges.get(edgeType).keySet){ + //find all classes the node belongs to + var classes = nodeToTypes.get(node); + for(cl : classes){ + // get or create entry for node type / edge type pair + var key = cl + ' ' + edgeType; + var typeCount = metric.get(key); + if(typeCount === null){ + typeCount = new ArrayList(); + metric.put(key, typeCount); + } + + // get or create sample list + typeCount.add(outgoingEdges.get(edgeType).get(node).size); + } + } + } + + return metric; + } + + override evaluate(GraphStatistic g) { + var metric = calculateMetric(g); + var output = new ArrayList(); + + output.add(newArrayList('Typed Out Degree')); + for(key : metric.keySet){ + var samples = metric.get(key); + var String[] outputForOnePair = newArrayOfSize(samples.size+1); + outputForOnePair.set(0, key); + for(var i = 0; i < samples.size; i++){ + outputForOnePair.set(i+1, samples.get(i)+''); + } + output.add(outputForOnePair); + } + + return output; + } + + override evaluateSamples(GraphStatistic g) { + return calculateMetric(g); + } + +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/predictor/LinearModel.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/predictor/LinearModel.xtend new file mode 100644 index 00000000..f0ded347 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/predictor/LinearModel.xtend @@ -0,0 +1,91 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.predictor + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.distance.StateData +import java.util.ArrayList +import java.util.HashMap +import java.util.List +import java.util.Map +import weka.core.matrix.LinearRegression +import weka.core.matrix.Matrix + +class LinearModel { + var double ridge; + var Map stateAndHistory; + List samples; + + new(double ridge){ + this.ridge = ridge; + stateAndHistory = new HashMap(); + samples = new ArrayList(); + } + + /** + * reset the current train data for regression to a new trajectory + * @param state: the last state of the trajectory + */ + def resetRegression(Object state){ + samples.clear(); + + if(stateAndHistory.containsKey(state)){ + var data = stateAndHistory.get(state); + var curState = state; + + samples.add(data); + + //loop through data until the oldest state in the record + while(stateAndHistory.containsKey(data.lastState) && data.lastState != curState){ + curState = data.lastState; + data = stateAndHistory.get(data.lastState); + samples.add(data); + } + } + } + + /** + * Add a new data point to the current training set + * @param state: the state on which the new data point is calculated + * @param features: the set of feature value(x) + * @param value: the value of the state (y) + * @param lastState: the state which transformed to current state, used to record the trajectory + */ + def feedData(Object state, double[] features, double value, Object lastState){ + var data = new StateData(features, value, lastState); + stateAndHistory.put(state, data); + samples.add(data); + } + + /** + * get prediction for next state, without storing the data point into the training set + * @param features: the feature values of current state + * @param value: the value of the current state + * @param: featuresToPredict: the features of the state wanted to be predected + * @return the value of the state to be predicted + */ + def double getPredictionForNextDataSample(double[] features, double value, double[] featuresToPredict){ + var data = new StateData(features, value, null); + samples.add(data); + + // create training set from current data + val double[][] xSamples = samples.map[it.features]; + val double[] ySamples = samples.map[it.value]; + + val x = new Matrix(xSamples); + val y = new Matrix(ySamples, ySamples.size()); + + val regression = new LinearRegression(x, y, ridge); + var prediction = predict(regression.coefficients, featuresToPredict); + + //remove the last element just added + samples.remove(samples.size - 1); + return prediction; + } + + def private predict(double[] parameters, double[] featuresToPredict){ + // the regression will add an initial column for 1's, the first parameter is constant term + var result = parameters.get(0); + for(var i = 0; i < featuresToPredict.length; i++){ + result += parameters.get(i) * featuresToPredict.get(i); + } + return result; + } +} \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/validation/ConstraintCollection.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/validation/ConstraintCollection.xtend new file mode 100644 index 00000000..685c5836 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/validation/ConstraintCollection.xtend @@ -0,0 +1,80 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.validation + +import java.util.ArrayList +import java.util.HashMap +import java.util.List +import java.util.Map +import org.eclipse.emf.common.notify.Notifier +import org.eclipse.emf.common.util.URI +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup +import org.eclipse.viatra.query.runtime.emf.EMFScope + +class ConstraintCollection{ + val constraints = new ArrayList(); + var BaseGeneratedPatternGroup patterns; + var List resources = new ArrayList(); + + + new(List constraints, List uris, BaseGeneratedPatternGroup patterns){ + this.constraints.addAll(constraints); + this.patterns = patterns; + setURIs(uris); + } + + new(List constraints, BaseGeneratedPatternGroup patterns){ + this.constraints.addAll(constraints); + this.patterns = patterns; + } + + def addModel(Notifier n ){ + resources.add(n); + } + + def setURIs(List uris){ + val resSet = new ResourceSetImpl(); + + for(uri : uris){ + var resource = resSet.getResource(URI.createURI(uri), true); + resources.add(resource); + } + + println('reading model finished') + } + + def List calculateViolations(){ + var results = new ArrayList(); + + for(resource : resources){ + val engine = initEngine(resource); + var matches = constraints.stream.mapToInt([ele| ele.querySpecification.getMatcher(engine).countMatches]).sum(); + results.add(matches); + } + + return results; + } + + def ArrayList> calculateViolationMaps(){ + val result = new ArrayList>() + + for(resource : resources){ + val map = new HashMap(); + val engine = initEngine(resource); + constraints.forEach[ + var count = it.querySpecification.getMatcher(engine).countMatches; + map.put(it.querySpecification.simpleName, count); + ]; + result.add(map); + } + return result; + } + + private def initEngine(Notifier r){ + var engine = ViatraQueryEngine.on(new EMFScope(r)); + //init patterns with the new engine + patterns.prepare(engine); + return engine; + } +} diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/validation/ViolationCheck.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/validation/ViolationCheck.xtend new file mode 100644 index 00000000..4db5f940 --- /dev/null +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/validation/ViolationCheck.xtend @@ -0,0 +1,66 @@ +package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.validation + +import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app.Domain +import com.google.common.reflect.ClassPath +import ecore.Ecore +import hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.Patterns +import java.util.ArrayList +import org.eclipse.emf.ecore.EObject +import org.eclipse.viatra.addon.validation.core.api.IConstraintSpecification + +class ViolationCheck { + /** + * Return the total number of violations + */ + def static int calculateViolationCounts(EObject root, Domain d){ + var packageName = ''; + if(d == Domain.Yakindumm){ + packageName = 'constraints.yakindumm'; + }else if (d == Domain.Ecore){ + packageName = 'constraints.ecore'; + }else if (d == Domain.Github){ + return -1; + } + + var constriants = loadConstraints(packageName); + var collections = new ConstraintCollection(constriants, Ecore.instance); + collections.addModel(root); + var results = collections.calculateViolations(); + if(results.size > 0){ + return results.get(0); + }else{ + throw new IllegalArgumentException("Calculate Violation Failed"); + } + } + + /** + * return a map contain the count for each type of violation + */ + def static violationMaps(EObject root){ + var constriants = loadConstraints('hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu'); + var collections = new ConstraintCollection(constriants, Patterns.instance); + collections.addModel(root); + var results = collections.calculateViolationMaps(); + if(results.size > 0){ + return results.get(0); + }else{ + throw new IllegalArgumentException("Calculate Violation Failed"); + } + } + + def static loadConstraints(String packageName){ + val constraints = new ArrayList(); + + val classPath = ClassPath.from(ClassLoader.systemClassLoader); + val classInfos = classPath.getTopLevelClasses(packageName); + for(info : classInfos){ + if(info.load.interfaces.contains(IConstraintSpecification)){ + //IConstraintSpecification only has one constructor with empty argument list + var constructor = info.load.constructors.get(0); + var instance = constructor.newInstance(); + constraints.add(instance as IConstraintSpecification); + } + } + return constraints + } +} diff --git a/Metrics/Metrics-Calculation/metrics_plot/.gitignore b/Metrics/Metrics-Calculation/metrics_plot/.gitignore new file mode 100644 index 00000000..dc53b109 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/.gitignore @@ -0,0 +1,10 @@ +# virtual enviroment +venv/ + +# python cache +*.pyc +.ipynb_checkpoints/ +.idea/ + +# keep folders +!.gitignore \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/input/.gitignore b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/input/.gitignore new file mode 100644 index 00000000..b3934b01 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/input/.gitignore @@ -0,0 +1,3 @@ +# ignore everything in this folder +* +!.gitignore \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/MPC.png new file mode 100644 index 00000000..a8772bdd Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Node_Activity.png new file mode 100644 index 00000000..9defdaff Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Node_Type.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Node_Type.png new file mode 100644 index 00000000..e98559bb Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Node_Type.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Out_Degree.png new file mode 100644 index 00000000..eec3f95e Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/ecore/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/MPC.png new file mode 100644 index 00000000..20df6086 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Node_Activity.png new file mode 100644 index 00000000..c7c18186 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Node_Type.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Node_Type.png new file mode 100644 index 00000000..6d7230db Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Node_Type.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Out_Degree.png new file mode 100644 index 00000000..eb157b8e Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/distances/yakindumm/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/MPC.png new file mode 100644 index 00000000..b8930a7b Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Node_Activity.png new file mode 100644 index 00000000..d55a000c Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Node_Type.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Node_Type.png new file mode 100644 index 00000000..554923f5 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Node_Type.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Out_Degree.png new file mode 100644 index 00000000..1a605f9a Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Violations.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Violations.png new file mode 100644 index 00000000..719249d4 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/ecore/Violations.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/MPC.png new file mode 100644 index 00000000..8f59786d Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Node_Activity.png new file mode 100644 index 00000000..a3775f23 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Node_Type.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Node_Type.png new file mode 100644 index 00000000..5d3f81e1 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Node_Type.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Out_Degree.png new file mode 100644 index 00000000..a89eb552 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Violations.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Violations.png new file mode 100644 index 00000000..50a4cba0 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/github/Violations.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/MPC.png new file mode 100644 index 00000000..fcff0dfe Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Node_Activity.png new file mode 100644 index 00000000..ad44025f Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Node_Type.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Node_Type.png new file mode 100644 index 00000000..a61d6e5a Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Node_Type.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Out_Degree.png new file mode 100644 index 00000000..4749db22 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Violations.png b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Violations.png new file mode 100644 index 00000000..ac09e580 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/output/yakindumm/Violations.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/src/BoxPlot.ipynb b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/src/BoxPlot.ipynb new file mode 100644 index 00000000..5db66bb3 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/src/BoxPlot.ipynb @@ -0,0 +1,362 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 173, + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import statistics\n", + "import os\n", + "import sys\n", + "lib_path = os.path.abspath(os.path.join('..','..', '..', 'utils'))\n", + "sys.path.append(lib_path)\n", + "from GraphType import GraphStat\n", + "import readCSV as reader\n", + "import constants\n", + "import DistributionMetrics as metrics" + ] + }, + { + "cell_type": "code", + "execution_count": 174, + "metadata": {}, + "outputs": [], + "source": [ + "def getModels(folderName, numberOfModels):\n", + " filenames = reader.readmultiplefiles(folderName, numberOfModels, False)\n", + " graphStats = [GraphStat(filename) for filename in filenames]\n", + " return graphStats" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Import" + ] + }, + { + "cell_type": "code", + "execution_count": 175, + "metadata": {}, + "outputs": [], + "source": [ + "domain = 'github'\n", + "mpc_guide = getModels('../input/{}/MPC/'.format(domain), 100)\n", + "na_guide = getModels('../input/{}/NodeActivity/'.format(domain), 100)\n", + "od_guide = getModels('../input/{}/OutDegree/'.format(domain), 100)\n", + "nt_guide = getModels('../input/{}/NodeType/'.format(domain), 100)\n", + "composite_guide = getModels('../input/{}/Composite/'.format(domain), 100)\n", + "composite_no_violations_guide = getModels('../input/{}/Composite_Without_Violations/'.format(domain), 100)\n", + "violations_guide = getModels('../input/{}/Violations/'.format(domain), 100)\n", + "human = getModels('../input/{}/Human/'.format(domain), 304)\n", + "model_types = [human, composite_guide, composite_no_violations_guide, mpc_guide, na_guide, od_guide, nt_guide, violations_guide]" + ] + }, + { + "cell_type": "code", + "execution_count": 176, + "metadata": {}, + "outputs": [], + "source": [ + "if domain == 'yakindumm':\n", + " type_map = {'Entry': 0.04257802080554814, 'Choice': 0.1267671379034409, 'State': 0.1596092291277674, 'Transition': 0.6138636969858629, 'Statechart': 0.010136036276340358, 'Region': 0.04467858095492131, 'Exit': 0.0018338223526273673, 'FinalState': 0.0005334755934915977}\n", + "elif domain == 'ecore':\n", + " type_map = {'EAttribute': 0.23539778449144008, 'EClass': 0.30996978851963747, 'EReference': 0.33081570996978854, 'EPackage': 0.012789526686807653, 'EAnnotation': 0.002517623363544813, 'EEnumLiteral': 0.07275931520644502, 'EEnum': 0.013645518630412891, 'EDataType': 0.004028197381671702, 'EParameter': 0.005941591137965764, 'EGenericType': 0.002014098690835851, 'EOperation': 0.009415911379657605, 'ETypeParameter': 0.0007049345417925478}\n", + "elif domain == 'github':\n", + " type_map = {'Project': 0.012636538873420432, 'Commit': 0.5525808524309276, 'User': 0.05847076461769116, 'Issue': 0.12743628185907047, 'PullRequest': 0.07560505461554937, 'IssueEvent': 0.17327050760334123}" + ] + }, + { + "cell_type": "code", + "execution_count": 177, + "metadata": {}, + "outputs": [], + "source": [ + "# import rep\n", + "mpc_rep = getModels('../input/{}/MPC_REP/'.format(domain), 1)\n", + "na_rep = getModels('../input/{}/NA_REP/'.format(domain), 1)\n", + "od_rep = getModels('../input/{}/OUT_DEGREE_REP/'.format(domain), 1)\n", + "rep = mpc_rep[0]\n", + "rep.na = na_rep[0].na\n", + "rep.out_d = od_rep[0].out_d\n", + "rep.nodeTypeStat = type_map" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Helper Functions" + ] + }, + { + "cell_type": "code", + "execution_count": 178, + "metadata": {}, + "outputs": [], + "source": [ + "def calculate_ks(dist1, dist2):\n", + " value, p= metrics.ks_distance(dist1, dist2)\n", + " return value" + ] + }, + { + "cell_type": "code", + "execution_count": 179, + "metadata": {}, + "outputs": [], + "source": [ + "def mkdir(path):\n", + " if not os.path.exists(path):\n", + " os.makedirs(path)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Plot Config" + ] + }, + { + "cell_type": "code", + "execution_count": 180, + "metadata": {}, + "outputs": [], + "source": [ + "output_path = '../output/{}/'.format(domain)\n", + "mkdir(output_path)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Draw diagrams" + ] + }, + { + "cell_type": "code", + "execution_count": 181, + "metadata": {}, + "outputs": [], + "source": [ + "def drawBoxDiagram(title, target, types, distance_func, label_position):\n", + " distances = []\n", + " for distributions in types:\n", + " distances.append([distance_func(target, distribution) for distribution in distributions])\n", + " fig, ax1 = plt.subplots()\n", + " fig.set_size_inches(5, 2)\n", + " result = plt.boxplot(distances)\n", + " ax1.xaxis.set_ticks_position(label_position) \n", + " texts = ax1.set_xticklabels(labels, rotation=90, fontsize=12)\n", + " plt.savefig('{}/{}.png'.format(output_path, title), dpi=500, bbox_inches=\"tight\")" + ] + }, + { + "cell_type": "code", + "execution_count": 182, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAATwAAAC4CAYAAAB+U1B8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAVhUlEQVR4nO3dfXRcdZ3H8fc3obRQKTa0C1oeWteHkya6h7YiaBa3LVrAA+wqPpQFEePWukt1F3UXGAVEogf8g92NcFz2VC3sJmjZFbraA61N1A0rSusjGNEKVkorBluggqEVv/vHnaST4WYyTWbu/d25n9c5OWTunc79MJn5zu/h3t+YuyMikgdNaQcQEUmKCp6I5IYKnojkhgqeiOSGCp6I5IYKnojkhgqeiOSGCt4kmJmeN5EM0ht3ch4zsxvMrD3tICJSPRW8yVkNLADuN7PvmdmHzGxu2qFEpDLTpWWTZ2YvBt4JXAQsATYB64AN7n4gzWwi8kIqeDViZguICt/7gCPdfU7KkUSkjLq0NWBm04HXAq8DjgV+nG4iEYmjgjcFZtZhZrcAjwPXAfcBr3T3pQkd/2zNGItUT13aSTCza4i6ry3AemCdu9+bQo7HgT8C/1nMoJalSAUqeJNgZncDXwTudPfhFHM0A2cRFd9zgIeIJk163P03aeUSCZUKXoMws1lEM8YXEo0lbiZq9d2RajCRgKjg1YiZbXD3c9POAWBmpwK9wInu3px2HpFQaMC7djrSPLiZTTezd5nZRuCbwCPAe9PMJB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2jXcfMzsMOBrYU/5A7n6Luy9x9yVz58495LDuXtWPiEicagre/cArzGyBmR0OvAvYUHafDcDFxd/PB/pclUdEAjPht5a5+x/M7FLgHqAZ+Ly7P2hm1wJb3X0DsBa4zcy2E7Xs3lXP0CIik1HV1zS6+0ZgY9m2q0p+HwbeXttoIiK1ZWn1PM1sCNiRysFFpJGd5O6xkwSpFTwRkaTpWloRyQ0VPBHJDRU8EckNFTwRyQ0VPBHJDRU8EcmN/wdFcwsZ07wi4AAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# draw mpc\n", + "mpc_types = []\n", + "labels = ['Hum', 'Comb+V', 'Comb-V', 'MPC', 'NA', 'OD', 'NTD', 'VIO']\n", + "for models in model_types:\n", + " mpc_types.append([model.mpc for model in models])\n", + "drawBoxDiagram('MPC', rep.mpc, mpc_types, calculate_ks, 'top')" + ] + }, + { + "cell_type": "code", + "execution_count": 183, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAATwAAAB/CAYAAAByvn5wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAJoElEQVR4nO3dT2hdaRnH8d8zmcRuxiGxwUX/TIJWSIjiQKguCmNwFq2LNosRmiIIDXQ114VuChfqWLkLZzNC0oWFFERIqswiBKkMaOIiixmaIkinoRCKdWIFIw0VKjFpeVw0ySS3J8lJzrn3vPe+3w9cuOfck3Of3pv8et7zvuc95u4CgBi8UnQBAFAvBB6AaBB4AKJB4AGIBoEHIBoEHoBoNHzgmdmlomuQwqlDopadUEuymGpp+MCTFMqXFUodErXshFqSRVNLMwQeAKRiRV1pcfjwYe/q6sq8n6WlJXV2dmYvqEnqkKhlJ9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n5Fo23mt8fFzd3d2anp7W6uqqpqen1d3drfHx8aYNOynwS8vSYBzey0L6TEKqBZ/r6+vT4OCgJicnN6+l3Vi+e/du0eVlwqVlALa5d++enj59qhs3bmzOeHzx4kU9fPiw6NJqiiYtEKG2tjaVSqVtMx6XSiW1tbUVXVpNEXhNwMy2PZLW1WugcZpaULzV1VWNjo5umw9vdHRUq6urRZdWUzRpm0BI58hCqgU76+3t1eDg4Lb58C5cuKDJycmiS6spjvCACJXLZY2Pj2tkZEQrKysaGRnR+Pg4Mx4DaD7MeFxnDEsBUAu7DUuhSQsgGgQegGgQeACiQeABiAaBByAaBB6AaBB4AKKRKvDM7LSZ3TezBTO7nPD6F8zst+uvf2JmXXkXCgBZ7Rl4ZtYi6ZqkM5J6JQ2ZWW/VZsOSlt39q5I+kPSLvAsFgKzSHOGdlLTg7g/cfVXSTUnnqrY5J+nX688/lPRdY1oMAIFJE3hHJH22ZXlxfV3iNu7+TNITSV/Ko0AAyEuawEs6Uqu+eDXNNjKzS2Y2Z2ZzS0tLaeqr/nnmWwNwYGkCb1HSsS3LRyU92mkbM3tV0uuSXrpLjLtfd/d+d+/v7Ozcd7FF3jgHQONLE3i3JZ0ws24za5N0XtJU1TZTkn64/vwdSdNO8gAIzJ7z4bn7MzN7V9JHklok3XD3T83sqqQ5d5+SNCbpN2a2oBdHdudrWTQAHESqCUDd/ZakW1Xrrmx5viLp+/mWBgD5KmwCUDNbktTc94QDUIQ33D2xk6CwwAOAeuNaWgDRIPAARIPAAxANAg9ANAg8ANEg8ABE4//8Jjci23haRwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# draw node activity\n", + "na_types = []\n", + "labels = []\n", + "for models in model_types:\n", + " na_types.append([model.na for model in models])\n", + "drawBoxDiagram('Node_Activity', rep.na, na_types, calculate_ks, 'top')" + ] + }, + { + "cell_type": "code", + "execution_count": 184, + "metadata": {}, + "output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cuNs0zLpj9GEA7aQLvtqQ3zGzKzF6RdF7SQkufBUk/2vr5PUlVJ3kABKbjQ3zc/amZXZR0S1JO0q/d/Z6ZXdGzB94uSLoh6bdmtqJnI7vzvSwaAPYi1VPL3H1R0mJL2+WmnzckfT/b0gAgW317apmZrUn6si8bBzDMXnf3xJMEfQs8ANhv3EsLIBoEHoBoEHgAokHgAYgGgQcgGgQegGj8H6rxrSKGgZAbAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# draw out degree\n", + "out_d_types = []\n", + "labels = []\n", + "for models in model_types:\n", + " out_d_types.append([model.out_d for model in models])\n", + "drawBoxDiagram('Out_Degree', rep.out_d, out_d_types, calculate_ks, 'top')" + ] + }, + { + "cell_type": "code", + "execution_count": 185, + "metadata": {}, + "outputs": [], + "source": [ + "def manual_ks(pdf1, pdf2):\n", + " result = 0\n", + " sum1 = 0\n", + " sum2 = 0\n", + " for(a, b) in zip(pdf1, pdf2):\n", + " sum1 += a\n", + " sum2 += b\n", + " result = max(result, abs(sum1-sum2))\n", + " return result\n" + ] + }, + { + "cell_type": "code", + "execution_count": 186, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Commit', 'Issue', 'IssueEvent', 'Project', 'PullRequest', 'User']\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAATwAAAB+CAYAAAC54q3VAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAJjUlEQVR4nO3dT2gc5xnH8d+TrcBGTY2EdIr/HnJYvD4Ei7TYhlQmAZ+US8Fx6KlbjAtRD20PhYU0TRGU9FCMiaGmunrj9GaKS06bw8q0eIWLsSIKJrYsJYcqS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05tod3L3m7l8/fvt3SbuTLRMA4ovSpX1J0tpn/c1I+v4m+5cl/a3ZB2Z2WtJpSdq7d2/EErEe3Wtga6IEXrOR9qZ9OzP7saQBSa81+9zdL0i6IH27WkrEGrEO3Wtga6IE3oykPWve75b05fqdzOx1SRVJr7n7/5IpLyxxr7Jm6elPQCeKEnjXJL1sZgckfSHpLUlvr93BzF6R9CdJJ9z934lXGYBWLaqsrSkGZFHLixbu/lDSO5I+kTQp6WN3nzCz981s6PFuf5D0XUl/MbN/mtnltlUMAFsUaR6eu1+RdGXdtnfX/PvrCdeFFuheA88v+Dst+Iv9LLrXwNYEHXg8NR1AklgtBUBuBN3CC1mzrnazbbQ+gXAQeFtEkAGdhy4tgNwg8ADkBoEXU7VaValUUqFQUKlUUrVaTbskABtgDC+GarWqSqWi0dFRHTt2TPV6XeVyWZJ06tSplKsDsB4tvBhGRkY0OjqqwcFBdXV1aXBwUKOjoxoZGUm7NABNWFpXGwcGBrzRaMQ+TpoTjwuFghYXF9XV1bW6bWlpSTt27NDy8nIqNUlMxka+mdm4uw80+4wWXgzFYlH1ev2pbfV6XcViMaWKAGyGMbwYKpWKTp48qe7ubt29e1d79+7VwsKCzp49m3ZpAJqghZcQupBA+Ai8GEZGRnTp0iXdvn1bjx490u3bt3Xp0iUuWgCB4qJFDKFctIi6hBatUOQBFy3aJJSLFu4e6QXkHYEXQ6VSUblcVq1W09LSkmq1msrlsiqVStqlAWiCq7QxrNxNMTw8rMnJSRWLRY2MjHCXBRAoxvAAZApjeAAgAg9AjhB4AHKDwAOQGwQegNwg8ADkRkfNw9voFqr125mmAqCZjgo8ggxAHHRpAeQGgQcgNwg8ALmR2r20ZjYraSqVHw4gy/a5e3+zD1ILPADYbnRpAeQGgQcgNwg8ALlB4AHIDQIPQG78HwoBy/VGK0Z1AAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# draw node type\n", + "labels = []\n", + "types = sorted(rep.nodeTypeStat.keys())\n", + "rep_type_dist = [float(rep.nodeTypeStat[key]) for key in types]\n", + "print(types)\n", + "node_type_types = []\n", + "for models in model_types:\n", + " type_dists = []\n", + " for model in models:\n", + " type_dists.append([float(model.nodeTypeStat.get(key, 0)) for key in types])\n", + " node_type_types.append(type_dists)\n", + "\n", + "#since we already know the pdf, we can compute the ks distance manually\n", + "drawBoxDiagram('Node_Type', rep_type_dist, node_type_types, manual_ks, 'top')" + ] + }, + { + "cell_type": "code", + "execution_count": 187, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAATkAAAC3CAYAAABpLCntAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAWfklEQVR4nO3de3RdZZnH8e/T0Kbcig2gQLE0juCERJ2ZdjE4yaileEWBQQUaUDQZGNbYeAEv2MwScCaMjC4FOzKKplhxEqqztKDMQoUT6KReW2/Uici1FalSoAwV7YX2mT/2TnuSnpOck5zz7n32+X3Wymqzd3repyfnPOfdz/u++zV3R0Qkq2YkHYCISDUpyYlIpinJiUimKcmJSKYpyYlIpinJiUimHRSysaOOOsoXLFgQskkRqQMbNmx4wt2PLnQuaJJbsGAB69evD9mkiNQBM9tU7JwuV0UkuMHBQdra2mhoaKCtrY3BwcGqtRW0JyciMjg4SG9vL/39/XR0dDA8PEx3dzcAS5curXh7FnJZ16JFi1yXqyL1ra2tjRUrVrB48eJ9x4aGhujp6WHjxo1Tekwz2+DuiwqeU5ITkZAaGhrYsWMHM2fO3Hds9+7dzJ49mz179kzpMSdKcqrJiUhQLS0tDA8Pjzk2PDxMS0tLVdpTkhORoHp7e+nu7mZoaIjdu3czNDREd3c3vb29VWlPAw8iEtTo4EJPTw8jIyO0tLTQ19dXlUEHUE1OR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5qK/f9GdEfVS4GXx3+extj9FkTqni5Xy5CmYr+ZPQq83N2fzDt2FPBzd58XMhaRNNPAQ3nSVOwv1ptMQy9TJDWU5Mrg7vckHUOerwHfNLOrgc1EO7b/U3xcRGKqyZUhZcX+DwF3Et1IdAPRVnc5oru/ikhMSa48iRf7zazdzK51913u/lF3f7G7H+LuJxJtf/dXoWIRqQUaeChDGor9ZnY7cIO7317g3OuBdye5H6xI2qgnV540FPv/ArijyLk7ie5ULCIxJbnyjBb7X2dmLXHPaQ1hi/1ziJaXFTKTaJ8FEYkpyZUnDcX+XxGtny3ktfF5EYkpyZUgZcX+TwOfN7Nz4n1OMbMZZnYO8DngUwFjEUk9zZMrzXLghiLnhoBeIEix390HzOwYYBXQGN/I8yhgB3Cluw+GiEOkVmh0tQTx3UfmF1qIb2YHAZvd/bjAMc0h2sT5SKIlZt9392dCxiBSC5TkSmBm24Hnu/ufCpw7GHjc3VXwF0kh1eRKo2K/SI1STa40o8X+BmCNu++Ni/5nE420XpZodCJSlJJcCVTsF6ldqsmVQcV+kdqjJCcimaaBBxHJNCU5Eck0JTkRyTQlORHJNCU5Ecm0/wfYU8r+ewW/nwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# draw violations\n", + "violation_types = []\n", + "labels = ['Hum', 'Comb+V', 'Comb-V', 'MPC', 'NA', 'OD', 'NTD', 'VIO']\n", + "for models in model_types:\n", + " violation_types.append([model.violations for model in models])\n", + "drawBoxDiagram('Violations', None, violation_types, lambda a, b:b, 'bottom')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/src/DistancePlot.ipynb b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/src/DistancePlot.ipynb new file mode 100644 index 00000000..44842cf4 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/Measurements/Measurement1/src/DistancePlot.ipynb @@ -0,0 +1,199 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "import os, sys\n", + "lib_path = os.path.abspath(os.path.join('..','..', '..', 'utils'))\n", + "sys.path.append(lib_path)\n", + "import glob\n", + "import matplotlib.pyplot as plt\n", + "from GraphType import GraphCollection\n", + "import DistributionMetrics as metrics\n", + "from GraphType import GraphStat\n", + "import readCSV as reader\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "def getModels(folderName, numberOfModels):\n", + " filenames = reader.readmultiplefiles(folderName, numberOfModels, False)\n", + " graphStats = [GraphStat(filename) for filename in filenames]\n", + " return graphStats" + ] + }, + { + "cell_type": "code", + "execution_count": 109, + "metadata": {}, + "outputs": [], + "source": [ + "# read models\n", + "domain = 'ecore'\n", + "rep = getModels('../input/{}/MPC_REP/'.format(domain), 1)[0]\n", + "na_rep = getModels('../input/{}/NA_REP/'.format(domain), 1)[0]\n", + "od_rep = getModels('../input/{}/OUT_DEGREE_REP/'.format(domain), 1)[0]\n", + "rep.na = na_rep.na\n", + "rep.out_d = od_rep.out_d\n", + "\n", + "human_models = getModels('../input/{}/Human/'.format(domain), 304)\n", + "folder = '../output/distances/{}/'.format(domain)\n", + "mkdir(folder)" + ] + }, + { + "cell_type": "code", + "execution_count": 111, + "metadata": {}, + "outputs": [], + "source": [ + "if domain == 'yakindumm':\n", + " rep.nodeTypeStat = {'Entry': 0.04257802080554814, 'Choice': 0.1267671379034409, 'State': 0.1596092291277674, 'Transition': 0.6138636969858629, 'Statechart': 0.010136036276340358, 'Region': 0.04467858095492131, 'Exit': 0.0018338223526273673, 'FinalState': 0.0005334755934915977}\n", + "elif domain == 'ecpre':\n", + " rep.nodeTypeStat = {'EAttribute': 0.23539778449144008, 'EClass': 0.30996978851963747, 'EReference': 0.33081570996978854, 'EPackage': 0.012789526686807653, 'EAnnotation': 0.002517623363544813, 'EEnumLiteral': 0.07275931520644502, 'EEnum': 0.013645518630412891, 'EDataType': 0.004028197381671702, 'EParameter': 0.005941591137965764, 'EGenericType': 0.002014098690835851, 'EOperation': 0.009415911379657605, 'ETypeParameter': 0.0007049345417925478}\n", + "node_types = sorted(rep.nodeTypeStat.keys())" + ] + }, + { + "cell_type": "code", + "execution_count": 112, + "metadata": {}, + "outputs": [], + "source": [ + "def plot_diagram(name, models, rep, metric, distance_metric):\n", + " model_metrics = list(map(metric, models))\n", + " rep = metric(rep)\n", + " distances= list(map(lambda m: distance_metric(m,rep), model_metrics))\n", + " plt.figure()\n", + " plt.title('{} for {}'.format(name, domain))\n", + " plt.hist(distances)\n", + " plt.savefig('{}/{}.png'.format(folder, name), dpi = 500)" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "metadata": {}, + "outputs": [], + "source": [ + "def mpc(model):\n", + " return model.mpc\n", + "def na(model):\n", + " return model.na\n", + "def od(model):\n", + " return model.out_d\n", + "\n", + "def nt(model):\n", + " nd_dict = model.nodeTypeStat\n", + " dist = []\n", + " for key in node_types:\n", + " dist.append(nd_dict.get(key, 0))\n", + " return dist\n", + "\n", + "def mkdir(path):\n", + " if not os.path.exists(path):\n", + " os.makedirs(path)\n", + "\n", + "def ks_distance(s1, s2):\n", + " value, p = metrics.ks_distance(s1, s2)\n", + " return value" + ] + }, + { + "cell_type": "code", + "execution_count": 114, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA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CQ5IUklWRb/5jYf+pmbJH/Q/exsTvKJxa5xWPr4nTo4ySVJrup+r44eRp33q6qW/Ae9N2VvBB4B7AZcAxw2qc8fAX/bPT4J+NSw615Cc/M7wEO6x690bn6l3x7ApcBlwNiw614qcwOsAa4C9u629xt23UtobjYAr+weHwbcMuy6J38slyP3fi5ncBywsXt8HrA2yVQnU7Vmxrmpqkuq6t5u8zJ65x3sDPq9DMbbgHcC/72YxQ1ZP3PzCuADVfUDgKravsg1Dks/c1PAnt3jh7EEz+NZLuE+1eUMVk3Xp6ruA+4B9l2U6oarn7mZ6BTgCwta0dIx49wkOQI4qKo+t5iFLQH9/NwcChya5GtJLkty1KJVN1z9zM2fAy9MshX4PPDqxSmtf8vleu4zXs6gzz4t6vv7TvJCYAx42oJWtHTc79wk2QV4H/CSxSpoCenn52YFvaWZp9N7tffVJIdX1d0LXNuw9TM3JwNnV9V7kjwZ+Gg3N/+78OX1Z7kcufdzOYNf9Emygt5Lpe8vSnXD1delHpI8E3gzcGxV/XSRahu2meZmD+Bw4CtJbgGeBFywk7yp2u/v1PlV9fOquhm4nl7Yt66fuTkFOBegqv4DeBC9i4otGcsl3Pu5nMEFwLru8QnAl6t7t6NxM85Nt/Twd/SCfWdZN4UZ5qaq7qmqlVU1WlWj9N6POLaqNg2n3EXVz+/UP9F7M54kK+kt09y0qFUORz9zcyuwFiDJY+iF+/iiVjmDZRHu3Rr6jssZXAecW1Wbk7w1ybFdt7OAfZNsAU4Fdoq7P/U5N+8Cdgc+neTqJDvFdX76nJudUp9z80XgriTXApcAf1ZVdw2n4sXT59y8HnhFkmuAc4CXLLWDSS8/IEkNWhZH7pKk2THcJalBhrskNchwl6QGGe6S1CDDXZIaZLhLUoP+D59k1Cf7AAB6AAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABH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MBkjyNXrjPr2qV+7Euwr0bQ983pcEu4NKquiXJryZ5YXfYxcBRSXYDrwEOiP8ANWTf/CZwGPDBJDclOWDm+hmyfw5IQ/bNR4EvJbkVuAZ4XVV9aToVr54h++a1wKuS3Ax8AHjFWrqgdPoBSWrQurhylySNxnCXpAYZ7pLUIMNdkhpkuEtSgwx3SWqQ4S5JDfr/Wwm8V3cQIukAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAASQUlEQVR4nO3deZDkZX3H8fcHFgRE5NgBYTkGzWIkJEZrVdSqaAQTBAMkBQbjsRjiWsQzoIBHReORgFGJpoy6EcPGMgTEAwqNQjiisYS4KIiAFAjIrqywICCgUZFv/ugfZmqc2emZnpmeefb9qurq3/18+5mZT//m6e5fp6qQJLVli2EXIEmafYa7JDXIcJekBhnuktQgw12SGmS4S1KDDHdpliU5PskdSR5Issuw69HmyXBXX5Icm+SaJD9J8sMkH0my4zT2vzXJwX1sN5qkumB8oAvJC5I8f7BHMD+SbAV8APiDqtq+qu4edk3aPBnumlKSE4HTgDcBjwUOBPYBLkqy9Rw1u2NVbQ88GbgI+FySY2e7kSRLZvmQuwHbANfOoJYkmfe/yWG1qzlWVd68TXoDdgAeAF40bvn2wJ3An3fzZwLvHrP+ucD6bvqTwMPAT7tjnbSJ9kaBApaMW/5G4A5gi25+D+AzwEbgFuB1Y7bdFlgD3ANcD5z0SC3d+luBk4FvAz8DlkxxvC2AU4DvAXcD5wA7T1D7fsCDXf0PAJd0y58FfAO4r7t/1ph9LgPeA3yt65/fmOC4m6ptS+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1T3KkfjpuybbtjhY/SCfXMZL33EJvunqu6rqqVVNVpVo/Rekzi8qtYOp9x518/f1ufpvShPkqX0hmluntcqh6OfvrkNOAggyZPohfvGea1yEosi3Lsx9EcuaXA9cE5VXZvknUkO7zY7A9glyU3ACcBm8Q1QffbN3wPbA59OclWSzeZaP332z2arz/75MnB3kuuAS4E3VdXdw6l4/vTZNycCr0xyNXAWcOxCOan08gOS1KBFceYuSZoew12SGmS4S1KDDHdJapDhLkkNMtwlqUGGuyQ16P8AtZaSS8ry4ocAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEICAYAAABGaK+TAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAATnUlEQVR4nO3df5TldX3f8eeLXX4oSvk1kA0LLCYrAZModUpoMB4jmKAo0AZTNDFrD2ZPW5PYhho32jbml67NqcRzYpNsIHWNMUK3cqCQmOAKtUkUXRRERAVxhQ2EHRGMP6pk8d0/7nflMjuz850fd+584Pk45557v7/m89ovw2u+87k/JlWFJKk9B4w7gCRpYSxwSWqUBS5JjbLAJalRFrgkNcoCl6RGWeAauSRvTvKecedYCkk2J3kwya5xZ5EscO0jyc4kDyQ5dGjda5LcOKY8tyf5end7NMm3hpbfuIw5TgJ+CTi5qtYu17jSbCxwzWY18LpxhwCoqmdV1dOq6mnA/wV+Ye9yVb1lGaOcCOyuqi/P98Akq0eQZ8WOq+VhgWs2vwP8xySHz7QxyY8m+XiSr3b3Pzq07aQk/yfJ15JcDxw97dgzkvxtkoeT3JrkBQsNmeSQ7uucMrRuTZJvJjkqydndbxT/pZv6+GKSi6Yd//Yk93a/dfz3JIfMMM45wF8AJ3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842bbp6r2AF8FjlqWdPvqk3elmG/Wi4G/GGmi/euVN8lrk3yBQSn+0jJlm8mceZOcBhxfVdcuZ7BZ9P1++KluSm1bkuNn2L5c+uR9JvDMJH+T5KPdp6WOQ+//17ppypOADy1koJVW4H3ent/rLfzLZCVlmUvvrEl+FpgEfmekifav70c1vLOqvg94A/CfRp5qdvvNm+QA4FLgkmVLtH99zu//BtZV1Q8DH+Sx33zHoU/e1QymUV7A4Kr2siSHjzjXTObTCxcB26rq0YUMtNIKvM/b87+7T5LVwD8BvrIs6fbV0scJ9Mqa5GzgTcB5VfXtZco2k/me2/cBF4w00f7NlffpwA8CNybZCZwBXDPGJzLnPL9V9eDQ98AfAc9dpmwz6dsNV1fVP1bVF4HPMSj05Taf792LWOD0CbDinsRcDdzN4FeKvZP/z5q2z2t5/JOYV67kvEP7vovxPonZ59yexuDJl/WNfC+sH3r8MmDHSs47bf8bGe+TmH3O75qhx/8C+OgKz3sOsLV7fDSDaYyjVmLWbr+TgZ10b6hc0Fjj+g+yn3/8S4DPd0Xypm7dbzC4IgQ4BPifwF3Ax4BnrPC8/4zBT+RvAA8Ct6/grB8EHgBu6W7XrPBz+w7g9i7rDfsrzJWQd9q+Yy3wnuf3rd35vbU7vz+wwvMGeDvwGeA24KKVmrVbfjOweTHj+FZ6SWrUSpsDlyT1ZIFLUqMscElqlAUuSY2ywCWpURa4JDXKApekRv1/7h9o49F9ucIAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plot_diagram('MPC', human_models, rep, mpc, ks_distance)\n", + "plot_diagram('Node_Activity', human_models, rep, na, ks_distance)\n", + "plot_diagram('Out_Degree', human_models, rep, od, ks_distance)\n", + "plot_diagram('Node_Type', human_models, rep, nt, metrics.manual_ks)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/input/.gitignore b/Metrics/Metrics-Calculation/metrics_plot/model comparison/input/.gitignore new file mode 100644 index 00000000..b3934b01 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/input/.gitignore @@ -0,0 +1,3 @@ +# ignore everything in this folder +* +!.gitignore \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/MPC.png new file mode 100644 index 00000000..ae4f5900 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png new file mode 100644 index 00000000..c94b8c2c Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node Types.png new file mode 100644 index 00000000..70abdd5b Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node Types.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png new file mode 100644 index 00000000..fe138084 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node_Activity.png new file mode 100644 index 00000000..a8a655f8 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png new file mode 100644 index 00000000..bc83145d Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Out_Degree.png new file mode 100644 index 00000000..ee97529b Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png new file mode 100644 index 00000000..0f6e8538 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/MPC.png new file mode 100644 index 00000000..d7ed3bbb Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Node Activity.png new file mode 100644 index 00000000..8a20963d Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Out Degree.png new file mode 100644 index 00000000..4354656c Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC.png new file mode 100644 index 00000000..b52aa827 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png new file mode 100644 index 00000000..6adb45e2 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types.png new file mode 100644 index 00000000..e257f381 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png new file mode 100644 index 00000000..2672ee2c Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity.png new file mode 100644 index 00000000..33adbfe9 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png new file mode 100644 index 00000000..d64df78b Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Types.png new file mode 100644 index 00000000..eb245365 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Types.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree.png new file mode 100644 index 00000000..2c8f53f6 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png new file mode 100644 index 00000000..86b7c3a0 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Node Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Node Types.png new file mode 100644 index 00000000..81085eab Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Node Types.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Node Types_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Node Types_lengend.png new file mode 100644 index 00000000..e92f1b26 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Node Types_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Out_Degree.png new file mode 100644 index 00000000..25b35ee7 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Out_Degree_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Out_Degree_lengend.png new file mode 100644 index 00000000..d2c660c0 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Alloy-rep-/Out_Degree_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png new file mode 100644 index 00000000..df162a5a Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..703f9c56 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..873a40c1 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Human rep-Viatra consistent (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png new file mode 100644 index 00000000..826b797f Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..babf7266 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..31f74863 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png new file mode 100644 index 00000000..a4717b87 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..946f2aa1 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..668423cc Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/MPC.png new file mode 100644 index 00000000..f4301083 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Node Activity.png new file mode 100644 index 00000000..fd27fdd4 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Out Degree.png new file mode 100644 index 00000000..39fc0cf9 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Alloy (30 nodes)-Realistic Viatra with Node Type KS (100 nodes)-Human-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png new file mode 100644 index 00000000..545aab79 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..6e92f726 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..a57f399b Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Human rep-Realistic Viatra with Node Type KS (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/MPC.png new file mode 100644 index 00000000..30d74805 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..2e34fead Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..bc9d6016 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Realistic Viatra no Exit (100 nodes)-Realistic Viatra consistent (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/MPC.png new file mode 100644 index 00000000..39e1c4ec Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..16ac54dd Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..99ebd383 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/MPC.png new file mode 100644 index 00000000..08983af2 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..704ac0f4 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..93ba4a66 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra V2 (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/MPC.png new file mode 100644 index 00000000..e0d5b199 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..ddcc2451 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..e0ea1c75 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra containers (100 nodes)-Realistic Viatra new (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/MPC.png new file mode 100644 index 00000000..430e7279 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..fc15d7f5 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..20499e22 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra new (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/MPC.png new file mode 100644 index 00000000..ab519eaa Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..7726b292 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..5416c350 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Realistic Viatra no Exit (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/MPC.png new file mode 100644 index 00000000..601fc7f1 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..76773aa4 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..2e459f1a Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra (100 nodes)-Viatra Consistent (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/MPC.png new file mode 100644 index 00000000..9d12c2d8 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..56745bc0 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..24f29731 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra no Exit Final (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/MPC.png new file mode 100644 index 00000000..dcd1eaa2 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..ac912936 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..4c9abbcb Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/KS Distance/Human-Viatra consistent (100 nodes)-Realistic Viatra (100 nodes)-Realistic Viatra with Node Type (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png new file mode 100644 index 00000000..4f8e97e2 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..7c2b5752 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..3cf659b2 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/MPC.png new file mode 100644 index 00000000..50b882da Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/Node Activity.png new file mode 100644 index 00000000..4e9a68d5 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/Out Degree.png new file mode 100644 index 00000000..bfa4b537 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/MPC.png new file mode 100644 index 00000000..33176821 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png new file mode 100644 index 00000000..53c46e6f Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png new file mode 100644 index 00000000..abf45ff1 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/Euclidean_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png new file mode 100644 index 00000000..07c97401 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..f2fb5229 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..d2677e99 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/MPC.png new file mode 100644 index 00000000..a375c676 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/Node Activity.png new file mode 100644 index 00000000..d69cd298 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/Out Degree.png new file mode 100644 index 00000000..0584ac99 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/MPC.png new file mode 100644 index 00000000..016cc2a3 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png new file mode 100644 index 00000000..55d32444 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png new file mode 100644 index 00000000..99cbbae4 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/JS_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png new file mode 100644 index 00000000..b8480ae0 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..82268167 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..41bcd510 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Realistic Viatra With Some Constraints (100 nodes)-Viatra (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/MPC.png new file mode 100644 index 00000000..b19bb958 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/Node Activity.png new file mode 100644 index 00000000..cccabc4e Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/Out Degree.png new file mode 100644 index 00000000..947ebdd2 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/MPC.png new file mode 100644 index 00000000..0ff4ee89 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/Node Activity.png new file mode 100644 index 00000000..1f9e2e18 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/Out Degree.png new file mode 100644 index 00000000..2c63cc3a Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Alloy (30 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/MPC.png new file mode 100644 index 00000000..8d76fed9 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png new file mode 100644 index 00000000..daa7929a Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png new file mode 100644 index 00000000..e56b1b6e Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/MPC.png new file mode 100644 index 00000000..8705cee2 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..bdab3741 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..e4269f6e Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Random-Viatra (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/MPC.png new file mode 100644 index 00000000..e4b6b527 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..e067ad66 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..9b89e4f9 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra (30 nodes)-Viatra (60 nodes)-Viatra (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/MPC.png new file mode 100644 index 00000000..820df5c7 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/Node Activity.png new file mode 100644 index 00000000..b6aa957a Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/Out Degree.png new file mode 100644 index 00000000..161041d9 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/Human-Viatra consistent (100 nodes)-/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/MPC.png new file mode 100644 index 00000000..4f189578 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/Node Activity.png new file mode 100644 index 00000000..add3c0f8 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/Node Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/Out Degree.png new file mode 100644 index 00000000..f4717a1a Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Yakindumm/old measurements/KS_Distance/real vs viatra vs alloy/Out Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/MPC.png new file mode 100644 index 00000000..d184e5bf Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png new file mode 100644 index 00000000..0dea77f2 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Activity.png new file mode 100644 index 00000000..192fe6f0 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png new file mode 100644 index 00000000..4db337ef Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Types.png new file mode 100644 index 00000000..2f24cda9 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Types.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png new file mode 100644 index 00000000..14dcc501 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Out_Degree.png new file mode 100644 index 00000000..6f40ea4d Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png new file mode 100644 index 00000000..f2e3230b Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/ecore/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/MPC.png new file mode 100644 index 00000000..834a91aa Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png new file mode 100644 index 00000000..b3783c77 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Activity.png new file mode 100644 index 00000000..2828f1fd Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png new file mode 100644 index 00000000..4a50e619 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Types.png new file mode 100644 index 00000000..991ff1ff Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Types.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png new file mode 100644 index 00000000..d13686c8 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Out_Degree.png new file mode 100644 index 00000000..12b4ce33 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png new file mode 100644 index 00000000..03fe9740 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/github/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-/TCC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-/TCC.png new file mode 100644 index 00000000..31a83155 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-/TCC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-/TCC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-/TCC_lengend.png new file mode 100644 index 00000000..e29f59cb Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-/TCC_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Rand-GS-Real-/TCC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Rand-GS-Real-/TCC.png new file mode 100644 index 00000000..a3d56a23 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Rand-GS-Real-/TCC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Rand-GS-Real-/TCC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Rand-GS-Real-/TCC_lengend.png new file mode 100644 index 00000000..58cefaff Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Rand-GS-Real-/TCC_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Real-/TCC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Real-/TCC.png new file mode 100644 index 00000000..e9614b89 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Real-/TCC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Real-/TCC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Real-/TCC_lengend.png new file mode 100644 index 00000000..f0cee20a Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/test/Hum-Real-/TCC_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/MPC.png new file mode 100644 index 00000000..a53bda79 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/MPC.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png new file mode 100644 index 00000000..7a49fb91 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/MPC_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Activity.png new file mode 100644 index 00000000..bf6ca9ba Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Activity.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png new file mode 100644 index 00000000..d82a124e Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Activity_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Types.png new file mode 100644 index 00000000..0e7b1e46 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Types.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png new file mode 100644 index 00000000..7f9e560e Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Node_Types_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Out_Degree.png new file mode 100644 index 00000000..928a0704 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Out_Degree.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png new file mode 100644 index 00000000..0059a925 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/yakindu/Hum-All-Rand-GS-Real-Med-/Out_Degree_lengend.png differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/src/plot_ks_stats.py b/Metrics/Metrics-Calculation/metrics_plot/model comparison/src/plot_ks_stats.py new file mode 100644 index 00000000..75fe78eb --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/src/plot_ks_stats.py @@ -0,0 +1,158 @@ +import os, sys +lib_path = os.path.abspath(os.path.join('..', '..', 'utils')) +sys.path.append(lib_path) +import glob +import random +from sklearn.manifold import MDS +import matplotlib.pyplot as plt +from scipy import stats +import numpy as np +from GraphType import GraphCollection +import DistributionMetrics as metrics + +def main(): + domain = 'github' + # read models + alloy = GraphCollection('../input/measurement2/{}/Alloy/'.format(domain), 100, 'All') + human = GraphCollection('../input/measurement2/{}/Human/'.format(domain), 304, 'Hum') + base = GraphCollection('../input/measurement2/{}/BaseViatra/'.format(domain), 100, 'GS') + real = GraphCollection('../input/measurement2/{}/RealViatra/'.format(domain), 100, 'Real') + random = GraphCollection('../input/measurement2/{}/Random/'.format(domain), 100, 'Rand') + na_rep = GraphCollection('../input/measurement2/{}/Human/na_rep/'.format(domain), 1, 'Med') + mpc_rep = GraphCollection('../input/measurement2/{}/Human/mpc_rep/'.format(domain), 1, 'Med') + od_rep = GraphCollection('../input/measurement2/{}/Human/od_rep/'.format(domain), 1, 'Med') + + # a hack to make the node type as the same as an exiting model + type_rep = GraphCollection('../input/measurement2/{}/Human/od_rep/'.format(domain), 1, 'Med') + if(domain == 'yakindu'): + type_rep.nts = [{'Entry': 0.04257802080554814, 'Choice': 0.1267671379034409, 'State': 0.1596092291277674, 'Transition': 0.6138636969858629, 'Statechart': 0.010136036276340358, 'Region': 0.04467858095492131, 'Exit': 0.0018338223526273673, 'FinalState': 0.0005334755934915977}] + elif (domain == 'ecore'): + type_rep.nts = [{'EAttribute': 0.23539778449144008, 'EClass': 0.30996978851963747, 'EReference': 0.33081570996978854, 'EPackage': 0.012789526686807653, 'EAnnotation': 0.002517623363544813, 'EEnumLiteral': 0.07275931520644502, 'EEnum': 0.013645518630412891, 'EDataType': 0.004028197381671702, 'EParameter': 0.005941591137965764, 'EGenericType': 0.002014098690835851, 'EOperation': 0.009415911379657605, 'ETypeParameter': 0.0007049345417925478}] + elif (domain == 'github'): + type_rep.nts = [{'Project': 0.012636538873420432, 'Commit': 0.5525808524309276, 'User': 0.05847076461769116, 'Issue': 0.12743628185907047, 'PullRequest': 0.07560505461554937, 'IssueEvent': 0.17327050760334123}] + + types = sorted(type_rep.nts[0].keys()) + + model_collections = [human, alloy, random, base, real] + for model_collection in model_collections: + print(model_collection.name) + length = len(model_collection.violations) + percentage = sum(map(lambda v: int(v==0), model_collection.violations)) / length + print(percentage) + + + models_to_compare_na = [human, alloy, random, base, real, na_rep] + models_to_compare_mpc = [human, alloy, random, base, real, mpc_rep] + models_to_compare_od = [human, alloy, random, base, real, od_rep] + models_to_compare_nt = [human, alloy, random, base, real, type_rep] + for modelCollection in models_to_compare_nt: + type_dists = [] + for nt in modelCollection.nts: + type_dist = [] + for key in types: + type_dist.append(nt.get(key, 0.0)) + type_dists.append(type_dist) + modelCollection.nts = type_dists + + + # define output folder + outputFolder = '../output/{}/'.format(domain) + + #calculate metrics + metricStat(models_to_compare_na, 'Node_Activity', nodeActivity, 0, outputFolder, calculateKSMatrix) + metricStat(models_to_compare_od, 'Out_Degree', outDegree, 1, outputFolder, calculateKSMatrix) + metricStat(models_to_compare_mpc, 'MPC', mpc, 2, outputFolder, calculateKSMatrix) + metricStat(models_to_compare_nt, 'Node_Types', nodeType, 3, outputFolder, calculateManualKSMatrix) + +def calculateKSMatrix(dists): + dist = [] + + for i in range(len(dists)): + dist = dist + dists[i] + matrix = np.empty((len(dist),len(dist))) + + for i in range(len(dist)): + matrix[i,i] = 0 + for j in range(i+1, len(dist)): + value, p= metrics.ks_distance(dist[i], dist[j]) + matrix[i, j] = value + matrix[j, i] = value + return matrix + +def calculateManualKSMatrix(dists): + dist = [] + + for i in range(len(dists)): + dist = dist + dists[i] + matrix = np.empty((len(dist),len(dist))) + + for i in range(len(dist)): + matrix[i,i] = 0 + for j in range(i+1, len(dist)): + value = metrics.manual_ks(dist[i], dist[j]) + matrix[i, j] = value + matrix[j, i] = value + return matrix + + +def calculateMDS(dissimilarities): + embedding = MDS(n_components=2, dissimilarity='precomputed') + trans = embedding.fit_transform(X=dissimilarities) + return trans + +def plot(graphTypes, coords, title='',index = 0, savePath = ''): + color = ['#377eb8' , '#e41a1c', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33'] + markers = ['o', '+', 'x', '^', 'v', '*'] + fill_styles = ['full', 'full', 'full', 'none', 'none', 'full'] + plt.figure(index, figsize=(5, 2)) + # plt.title(title) + index = 0 + for i in range(len(graphTypes)): + x = (coords[index:index+graphTypes[i].size, 0].tolist()) + y = (coords[index:index+graphTypes[i].size, 1].tolist()) + index += graphTypes[i].size + plt.plot(x, y, color=color[i], marker=markers[i], label = graphTypes[i].name, linestyle='', alpha=0.7, fillstyle = fill_styles[i]) + plt.savefig(fname = savePath+'.png', dpi=500) + plt.legend(loc='upper right') + plt.savefig(fname = savePath+'_lengend.png', dpi=500) + +def mkdir_p(mypath): + '''Creates a directory. equivalent to using mkdir -p on the command line''' + + from errno import EEXIST + from os import makedirs,path + + try: + makedirs(mypath) + except OSError as exc: # Python >2.5 + if exc.errno == EEXIST and path.isdir(mypath): + pass + else: raise + +def metricStat(graphTypes, metricName, metric, graphIndex, outputFolder, matrix_calculator): + metrics = [] + for graph in graphTypes: + metrics.append(metric(graph)) + outputFolder = outputFolder + graph.name + '-' + print('calculate' + metricName +' for ' + outputFolder) + mkdir_p(outputFolder) + out_d_coords = calculateMDS(matrix_calculator(metrics)) + plot(graphTypes, out_d_coords, metricName, graphIndex,outputFolder + '/'+ metricName) + +def nodeActivity(graphType): + return graphType.nas + +def outDegree(graphType): + return graphType.out_ds + +def mpc(graphType): + return graphType.mpcs + +def nodeType(graphType): + return graphType.nts + +def tcc(graphType): + return graphType.tccs + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/input/.gitignore b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/input/.gitignore new file mode 100644 index 00000000..b3934b01 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/input/.gitignore @@ -0,0 +1,3 @@ +# ignore everything in this folder +* +!.gitignore \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/Node Activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/Node Activity.jpg new file mode 100644 index 00000000..6b987b3e Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/Node Activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/mpc.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/mpc.jpg new file mode 100644 index 00000000..ee8d5755 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/mpc.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/out_degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/out_degree.jpg new file mode 100644 index 00000000..25e850fe Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_all/out_degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/Node Activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/Node Activity.jpg new file mode 100644 index 00000000..8b3421b1 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/Node Activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/mpc.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/mpc.jpg new file mode 100644 index 00000000..d459f5c8 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/mpc.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/out_degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/out_degree.jpg new file mode 100644 index 00000000..fdaa28e6 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_mpc/out_degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/Node Activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/Node Activity.jpg new file mode 100644 index 00000000..08445457 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/Node Activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/mpc.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/mpc.jpg new file mode 100644 index 00000000..74ab2449 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/mpc.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/out_degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/out_degree.jpg new file mode 100644 index 00000000..61c4489e Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_node_activity/out_degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/Node Activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/Node Activity.jpg new file mode 100644 index 00000000..ccbca653 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/Node Activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/mpc.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/mpc.jpg new file mode 100644 index 00000000..31965557 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/mpc.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/out_degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/out_degree.jpg new file mode 100644 index 00000000..d4de5301 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/controled_viatra_with_out_degree/out_degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/mpc.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/mpc.jpg new file mode 100644 index 00000000..ee1d84dc Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/mpc.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/node activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/node activity.jpg new file mode 100644 index 00000000..1a7e8bed Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/node activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/out degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/out degree.jpg new file mode 100644 index 00000000..81d9b709 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf/out degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/Node Activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/Node Activity.jpg new file mode 100644 index 00000000..e26d6cf6 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/Node Activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/mpc.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/mpc.jpg new file mode 100644 index 00000000..e1b9a1cf Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/mpc.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/out_degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/out_degree.jpg new file mode 100644 index 00000000..713ed4f4 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_instantiator/out_degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/mpc.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/mpc.jpg new file mode 100644 index 00000000..9c26be81 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/mpc.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/node activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/node activity.jpg new file mode 100644 index 00000000..3cb75479 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/node activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/out degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/out degree.jpg new file mode 100644 index 00000000..0a869df6 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/random_emf_normal/out degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/MPC.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/MPC.jpg new file mode 100644 index 00000000..b6e86773 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/MPC.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/node activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/node activity.jpg new file mode 100644 index 00000000..486577a6 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/node activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/out degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/out degree.jpg new file mode 100644 index 00000000..4f338049 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_constraints/out degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/Node Activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/Node Activity.jpg new file mode 100644 index 00000000..c1dba220 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/Node Activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/mpc.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/mpc.jpg new file mode 100644 index 00000000..f51449d0 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/mpc.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/out_degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/out_degree.jpg new file mode 100644 index 00000000..dff91312 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_control_all_with_consistency/out_degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/MPC.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/MPC.jpg new file mode 100644 index 00000000..2dc66b35 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/MPC.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/node activity.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/node activity.jpg new file mode 100644 index 00000000..847bad62 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/node activity.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/out degree.jpg b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/out degree.jpg new file mode 100644 index 00000000..90ff8006 Binary files /dev/null and b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/output/viatra_no_constraints/out degree.jpg differ diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/metrics_distance.ipynb b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/metrics_distance.ipynb new file mode 100644 index 00000000..550e3978 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/metrics_distance.ipynb @@ -0,0 +1,481 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Compare Metrics Distances to The Human Models" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Imports" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [], + "source": [ + "from GraphType import GraphStat\n", + "from GraphType import GraphCollection\n", + "from scipy import stats\n", + "from ipywidgets import interact, fixed, interactive\n", + "import readCSV as reader\n", + "import ipywidgets as widgets\n", + "import matplotlib.pyplot as plt\n", + "import random\n", + "import numpy as np\n", + "import constants\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Classes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Record the average distances of different metrics for a model to the human models " + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [], + "source": [ + "class GraphDistance:\n", + " #init with a graph stat and a collection of graph stats\n", + " def __init__(self, graphStat, collection):\n", + " self.graph = graphStat\n", + " self.collection = collection\n", + " self.out_d_distance = average_ks_distance(collection.out_ds, graphStat.out_d)\n", + " self.na_distance = average_ks_distance(collection.nas, graphStat.na)\n", + " self.mpc_distance = average_ks_distance(collection.mpcs, graphStat.mpc)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Methods" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Calculate the average ks distance" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [], + "source": [ + "def average_ks_distance(targets, sample):\n", + " distance = 0.0\n", + " for target in targets:\n", + " value, p = stats.ks_2samp(target, sample)\n", + " distance += value\n", + " distance = distance / len(targets)\n", + " return distance\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "pycharm": { + "name": "#%% md\n" + } + }, + "source": [ + "* Find the median ks distance of the same number of nodes" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "def find_median(x, metric_distances):\n", + " distance_dic = {}\n", + " for index, num_of_nodes in enumerate(x):\n", + " if num_of_nodes[0] not in distance_dic:\n", + " distance_dic[num_of_nodes[0]] = []\n", + " distance_dic[num_of_nodes[0]].append(metric_distances[index])\n", + " median_x = []\n", + " y = []\n", + " for num_of_nodes, distances in distance_dic.items():\n", + " median_x.append(num_of_nodes)\n", + " y.append(np.median(distances))\n", + " order = np.argsort(median_x)\n", + " median_x = np.array(median_x)[order]\n", + " median_y = np.array(y)[order]\n", + " return median_x, median_y\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Plot Diagram" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [], + "source": [ + "# metric_selector: GraphDistance -> float\n", + "def plot(infos, lines, id, metric_selector,colors, title):\n", + " metric_distances = retrive_info_from_list(metric_selector, list(infos.values()))\n", + " x = retrive_info_from_list(lambda a : a.graph.num_nodes, list(infos.values()))\n", + " graph = plt.figure(id,figsize=(18, 10))\n", + " plt.title(title)\n", + " plt.plot(x, metric_distances, color='red', linestyle='', marker='o',alpha=0.7)\n", + " #plot ks distance median\n", + " median_x, median_y = find_median(x, metric_distances)\n", + " plt.plot(median_x, median_y, color='black',marker='o')\n", + " for i in range(0, len(lines)):\n", + " line_infos = retrive_info_from_list(lambda a: infos[a], lines[i])\n", + " line_y = retrive_info_from_list(metric_selector, line_infos)\n", + " line_x = retrive_info_from_list(lambda a : a.graph.num_nodes, line_infos)\n", + " plt.plot(line_x, line_y, marker='o', color=colors[i])\n", + " #graph.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Retrieve information from a list " + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [], + "source": [ + "def retrive_info_from_list(selector, distances):\n", + " return list(map(selector, distances))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Read Models" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [], + "source": [ + "human = GraphCollection('../statistics/humanOutput/', 300, 'Human', True)\n", + "file_names = reader.readmultiplefiles('../statistics/viatraEvolve/', 1000, False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Calculate Distances" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [], + "source": [ + "# Progress Widge\n", + "w2 = widgets.FloatProgress(\n", + " value=0,\n", + " min=0,\n", + " max=1.0,\n", + " step=0.1,\n", + " description='Loading Files...:',\n", + " bar_style='info',\n", + " orientation='horizontal'\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ca7932bce2a741afaff6b919042c42b0", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatProgress(value=0.0, bar_style='info', description='Loading Files...:', max=1.0)" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "infos = []\n", + "# read all files\n", + "counter = 0.0\n", + "size = len(file_names)\n", + "#display progress bar\n", + "display(w2)\n", + "for name in file_names:\n", + " infos.append(GraphStat(name))\n", + "\n", + "info_dic = {}\n", + "for info in infos:\n", + " w2.value = (counter/size)\n", + " counter+=1\n", + " info = GraphDistance(info, human)\n", + " info_dic[info.graph.id] = info" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Plot Graphs" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* widget for select trajectory" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [], + "source": [ + "filenames = reader.readmultiplefiles('../statistics/trajectories/', 10, False)\n", + "trajectories = {}\n", + "for name in filenames:\n", + " trajectories[name] = reader.readTrajectory(name)\n", + "\n", + "w = widgets.SelectMultiple(\n", + " options = trajectories,\n", + " value = [trajectories[filenames[0]]],\n", + " description='Trajectory:',\n", + " disabled=False,\n", + ")\n", + "\n", + "#generate random color for each line\n", + "colors = []\n", + "\n", + "for i in range(0, len(trajectories)):\n", + " color = \"#%06x\" % random.randint(0, 0xFFFFFF)\n", + " colors.append(color)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Out Degree" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "08da62cb0c3f4e6e9591c7dc811d27cc", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', index=(1,), options={'../statistics/trajectori…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 63, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(info_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out degree')\n", + "interact(plot_out_degree, lines=w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Node Activity" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a708f43645a24bd2b15b53ea12c7d88f", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', index=(1,), options={'../statistics/trajectori…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 64, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_na(lines):\n", + " plot(info_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity')\n", + "interact(plot_na, lines=w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### MPC" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "124a0cb0ebfb4225bf4ced24c09032f7", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', index=(1,), options={'../statistics/trajectori…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(info_dic, lines, 0, lambda a: a.mpc_distance, colors, 'MPC')\n", + "interact(plot_out_degree, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "for name in file_names:\n", + " contents = reader.readcsvfile(name)\n", + " if(contents['State Id'][0] == 1032396643):\n", + " print(name)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "pycharm": { + "stem_cell": { + "cell_type": "raw", + "metadata": { + "collapsed": false + }, + "source": [] + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/metrics_distance_with_selector.ipynb b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/metrics_distance_with_selector.ipynb new file mode 100644 index 00000000..000822bf --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/metrics_distance_with_selector.ipynb @@ -0,0 +1,1600 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Measuremments with Representative" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Imports" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import os, sys\n", + "lib_path = os.path.abspath(os.path.join('..', '..', 'utils'))\n", + "sys.path.append(lib_path)\n", + "from GraphType import GraphStat\n", + "from GraphType import GraphCollection\n", + "from scipy import stats\n", + "from ipywidgets import interact, fixed, interactive\n", + "import readCSV as reader\n", + "import ipywidgets as widgets\n", + "import matplotlib.pyplot as plt\n", + "import random\n", + "import numpy as np\n", + "import constants\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Classes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Record the distances of different metrics using a representative" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "class GraphDistanceWithRep:\n", + " #init with a graph stat and a collection of graph stats\n", + " def __init__(self, graphStat, rep):\n", + " self.graph = graphStat\n", + " self.rep = rep\n", + " self.out_d_distance, _ = stats.ks_2samp(graphStat.out_d, rep.out_d)\n", + " self.na_distance,_ = stats.ks_2samp(graphStat.na, rep.na)\n", + " self.mpc_distance,_ = stats.ks_2samp(graphStat.mpc, rep.mpc)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Methods\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Find the median ks distance of the same number of nodes" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def find_median(x, metric_distances):\n", + " distance_dic = {}\n", + " for index, num_of_nodes in enumerate(x):\n", + " if num_of_nodes[0] not in distance_dic:\n", + " distance_dic[num_of_nodes[0]] = []\n", + " distance_dic[num_of_nodes[0]].append(metric_distances[index])\n", + " median_x = []\n", + " y = []\n", + " for num_of_nodes, distances in distance_dic.items():\n", + " median_x.append(num_of_nodes)\n", + " y.append(np.median(distances))\n", + " order = np.argsort(median_x)\n", + " median_x = np.array(median_x)[order]\n", + " median_y = np.array(y)[order]\n", + " return median_x, median_y\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Plot Diagram" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# metric_selector: GraphDistance -> float\n", + "def plot(infos, lines, id, metric_selector,colors, title, foldername):\n", + " metric_distances = retrive_info_from_list(metric_selector, list(infos.values()))\n", + " x = retrive_info_from_list(lambda a : a.graph.num_nodes, list(infos.values()))\n", + " graph = plt.figure(id,figsize=(18, 10))\n", + " plt.title(title)\n", + " plt.plot(x, metric_distances, color='red', linestyle='', marker='o',alpha=0.7)\n", + " #plot ks distance median\n", + " median_x, median_y = find_median(x, metric_distances)\n", + " plt.plot(median_x, median_y, color='black',marker='o')\n", + " for i in range(0, len(lines)):\n", + " line_infos = retrive_info_from_list(lambda a: infos[a], lines[i])\n", + " line_y = retrive_info_from_list(metric_selector, line_infos)\n", + " line_x = retrive_info_from_list(lambda a : a.graph.num_nodes, line_infos)\n", + " plt.plot(line_x, line_y, marker='o', color=colors[i])\n", + " mkdir_p(foldername)\n", + " plt.savefig(fname = foldername+title+'.jpg', dpi=150)\n", + " #graph.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Retrieve information from a list " + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "def retrive_info_from_list(selector, distances):\n", + " return list(map(selector, distances))" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "def readStats(path, numModels):\n", + " names = reader.readmultiplefiles(path, numModels, False)\n", + " stats = []\n", + " for name in names:\n", + " stats.append(GraphStat(name))\n", + " return stats" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "def calDistanceDic(stats, rep):\n", + " dic = {}\n", + " for info in stats:\n", + " info = GraphDistanceWithRep(info, rep)\n", + " dic[info.graph.id] = info\n", + " return dic" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "def createRandomColors(size):\n", + " #generate random color for each line\n", + " colors = []\n", + "\n", + " for i in range(0, size):\n", + " color = \"#%06x\" % random.randint(0, 0xFFFFFF)\n", + " colors.append(color)\n", + " return colors" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "def createSelectionWidge(options):\n", + " w = widgets.SelectMultiple(\n", + " options = options,\n", + " value = [],\n", + " description='Trajectory:',\n", + " disabled=False,\n", + " )\n", + " return w" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "def mkdir_p(mypath):\n", + " '''Creates a directory. equivalent to using mkdir -p on the command line'''\n", + "\n", + " from errno import EEXIST\n", + " from os import makedirs,path\n", + "\n", + " try:\n", + " makedirs(mypath)\n", + " except OSError as exc: # Python >2.5\n", + " if exc.errno == EEXIST and path.isdir(mypath):\n", + " pass\n", + " else: raise" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Metrics During GenerationPlots" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Read Human Representatives" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "### Read Models\n", + "#read representative\n", + "human_rep = GraphStat(constants.HUMAN_OUT_D_REP)\n", + "human_na = GraphStat(constants.HUMAN_NA_REP)\n", + "human_mpc = GraphStat(constants.HUMAN_MPC_REP)\n", + "\n", + "# assign rep distributions to human_rep\n", + "human_rep.na = human_na.na\n", + "human_rep.mpc = human_mpc.mpc" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Viatra No Constraint" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "# Read generated models\n", + "viatra_no_con_stats = readStats('../input/viatra_nocon_output/', 5000)\n", + "viatra_no_con_dic = calDistanceDic(viatra_no_con_stats, human_rep)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "filenames = reader.readmultiplefiles('../input/viatra_nocon_output/trajectories/', 15, False)\n", + "trajectories = {}\n", + "for name in filenames:\n", + " trajectories[name] = reader.readTrajectory(name)\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a8471e4dd66a47ecb6abb2371be43321", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={'../input/viatra_nocon_output/traject…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(viatra_no_con_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out degree', '../output/viatra_no_constraints/')\n", + "interact(plot_out_degree, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ad6e466cc3fe44d393d2c82d48244d83", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={'../input/viatra_nocon_output/traject…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_na(lines):\n", + " plot(viatra_no_con_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity', '../output/viatra_no_constraints/')\n", + "interact(plot_out_na, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "d88ebc8e4062473a96ac35fe800028ef", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={'../input/viatra_nocon_output/traject…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_mpc(lines):\n", + " plot(viatra_no_con_dic, lines, 0, lambda a: a.mpc_distance, colors, 'MPC', '../output/viatra_no_constraints/')\n", + "interact(plot_out_mpc, lines=w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Viatra with constraints" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "viatra_con_stats = readStats('../input/viatra_con_output/',5000)\n", + "viatra_con_dic = calDistanceDic(viatra_con_stats, human_rep)\n", + "\n", + "# trajectories and colors\n", + "trajectories = {}\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "1eb2ba5848a048389bca8d804fc8340a", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(viatra_con_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out degree', '../output/viatra_constraints/')\n", + "interact(plot_out_degree, lines=[[]])" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "6e5840f7a5ad4515bce9080088b644f2", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_na(lines):\n", + " plot(viatra_con_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity', '../output/viatra_constraints/')\n", + "interact(plot_na, lines=[[]])" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "9e30f267b092491ba1ffe8f83c5f68ce", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_mpc(lines):\n", + " plot(viatra_con_dic, lines, 0, lambda a: a.mpc_distance, colors, 'MPC', '../output/viatra_constraints/')\n", + "interact(plot_mpc, lines=[[]])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Controlled RandomEMF" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "random_emf_stats = readStats('../input/random_emf_output/',5000)\n", + "random_emf_dic = calDistanceDic(random_emf_stats, human_rep)\n", + "\n", + "# trajectories and colors\n", + "trajectories = {}\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "cc1f64c92e814c32a81cd5ec5d4e50dc", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(random_emf_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out degree', '../output/random_emf/')\n", + "interact(plot_out_degree, lines=[[]])" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "75021f4f68db4a809ce7c86c0d25ef1b", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_node_activity(lines):\n", + " plot(random_emf_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity', '../output/random_emf/')\n", + "interact(plot_node_activity, lines=[[]])" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "86f5c376905a4759a7b44ad52804424d", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_mpc(lines):\n", + " plot(random_emf_dic, lines, 0, lambda a: a.mpc_distance, colors, 'mpc', '../output/random_emf/')\n", + "interact(plot_mpc, lines=[[]])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Controlled Viatra with MPC" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "con_viatra_stats = readStats('../input/controled_viatra_mpc/',5000)\n", + "con_viatra_dic = calDistanceDic(con_viatra_stats, human_rep)\n", + "\n", + "# trajectories and colors\n", + "trajectories = {}\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "57ba4d8443c145ad845fb862e3ef7519", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out_degree', '../output/controled_viatra_with_mpc/')\n", + "interact(plot_out_degree, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c020ecb466c14f3ca1bfc0fd2fe03b7b", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_na(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.na_distance, colors, 'Node Activity', '../output/controled_viatra_with_mpc/')\n", + "interact(plot_na, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "2165668057fd47ad92459e749ec68bad", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_mpc(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.mpc_distance, colors, 'mpc', '../output/controled_viatra_with_mpc/')\n", + "interact(plot_mpc, lines=w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## (Pseudo) Random EMF instantiator" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [], + "source": [ + "random_emf_stats = readStats('../input/real_random_output/',5000)\n", + "random_emf_dic = calDistanceDic(random_emf_stats, human_rep)\n", + "\n", + "# trajectories and colors\n", + "trajectories = {}\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "907d7824033b4dfe980c391db0da63eb", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(random_emf_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out_degree', '../output/random_emf_instantiator/')\n", + "interact(plot_out_degree, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "08a32c21d0b64217a556715caa8db7b5", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_na(lines):\n", + " plot(random_emf_dic, lines, 0, lambda a: a.na_distance, colors, 'Node Activity', '../output/random_emf_instantiator/')\n", + "interact(plot_na, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "9dad041ff05d46ce969cfacb07c2ba98", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_mpc(lines):\n", + " plot(random_emf_dic, lines, 0, lambda a: a.mpc_distance, colors, 'mpc', '../output/random_emf_instantiator/')\n", + "interact(plot_mpc, lines=w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Controlled Viatra with Out Degree" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [], + "source": [ + "con_viatra_stats = readStats('../input/controlled_viatra_out_degree/',10000)\n", + "con_viatra_dic = calDistanceDic(con_viatra_stats, human_rep)\n", + "\n", + "# trajectories and colors\n", + "trajectories = {}\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "cd77560284d9419daec57192a64b75ec", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out_degree', '../output/controled_viatra_with_out_degree/')\n", + "interact(plot_out_degree, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ab11afebf7674cebae8d7318c661cf3c", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_na(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.na_distance, colors, 'Node Activity', '../output/controled_viatra_with_out_degree/')\n", + "interact(plot_na, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "scrolled": false + }, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c20b42abcba646c18d7caa6eeb54c403", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_mpc(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.mpc_distance, colors, 'mpc', '../output/controled_viatra_with_out_degree/')\n", + "interact(plot_mpc, lines=w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Controlled Viatra with Node Activity" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [], + "source": [ + "con_viatra_stats = readStats('../input/controlled_viatra_out_degree_node_activity/',20000)\n", + "con_viatra_dic = calDistanceDic(con_viatra_stats, human_rep)\n", + "\n", + "# trajectories and colors\n", + "trajectories = {}\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "902b580a11fa4c8db9d03508ad629067", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out_degree', '../output/controled_viatra_with_node_activity/')\n", + "interact(plot_out_degree, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "851b567e745940288b577d9bd27e6f08", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_na(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.na_distance, colors, 'Node Activity', '../output/controled_viatra_with_node_activity/')\n", + "interact(plot_na, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "7de173291f394b10b5113e3312b7b2e1", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_mpc(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.mpc_distance, colors, 'mpc', '../output/controled_viatra_with_node_activity/')\n", + "interact(plot_mpc, lines=w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Random EMF With Normal(2,1)" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [], + "source": [ + "random_emf_stats = readStats('../input/random_emf_normal/',6000)\n", + "random_emf_dic = calDistanceDic(random_emf_stats, human_rep)\n", + "\n", + "# trajectories and colors\n", + "trajectories = {}\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "6b9ee873d9ca41649cf05f3b713d9142", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(random_emf_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out degree', '../output/random_emf_normal/')\n", + "interact(plot_out_degree, lines=[[]])" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "88f258a0b0ac4417aba320beca7508cf", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_node_activity(lines):\n", + " plot(random_emf_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity', '../output/random_emf_normal/')\n", + "interact(plot_node_activity, lines=[[]])" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "d71cf26018184ee6953c50b74908f52d", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_mpc(lines):\n", + " plot(random_emf_dic, lines, 0, lambda a: a.mpc_distance, colors, 'mpc', '../output/random_emf_normal/')\n", + "interact(plot_mpc, lines=[[]])" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [], + "source": [ + "con_viatra_stats = readStats('../input/controlled_viatra_all/',20000)\n", + "con_viatra_dic = calDistanceDic(con_viatra_stats, human_rep)\n", + "\n", + "# trajectories and colors\n", + "trajectories = {}\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "db15ac26aad84683b9da99fc54749850", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out_degree', '../output/controled_viatra_all/')\n", + "interact(plot_out_degree, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "30bfaf8dd45d4b21b0b43afe5e9fdb8a", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_na(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.na_distance, colors, 'Node Activity', '../output/controled_viatra_all/')\n", + "interact(plot_na, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "5636d37b4416474db5441fe47e7a8a30", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_mpc(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.mpc_distance, colors, 'mpc', '../output/controled_viatra_all/')\n", + "interact(plot_mpc, lines=w)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Viatra With Both metric and consistency" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [], + "source": [ + "con_viatra_stats = readStats('../input/viatra_control_all_with_consistency_1/',20000)\n", + "con_viatra_dic = calDistanceDic(con_viatra_stats, human_rep)\n", + "\n", + "# trajectories and colors\n", + "trajectories = {}\n", + "w = createSelectionWidge(trajectories)\n", + "colors = createRandomColors(len(trajectories))" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "e5c7231686544d959527cff36c1f1a5e", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_out_degree(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out_degree', '../output/viatra_control_all_with_consistency_1/')\n", + "interact(plot_out_degree, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "e043705333bb474e89582ea9358c57c3", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_na(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.na_distance, colors, 'Node Activity', '../output/viatra_control_all_with_consistency_1/')\n", + "interact(plot_na, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ee4723b62293402e87e6a3f798019b36", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='Trajectory:', options={}, value=()), Output()), _dom_classes…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def plot_mpc(lines):\n", + " plot(con_viatra_dic, lines, 0, lambda a: a.mpc_distance, colors, 'mpc', '../output/viatra_control_all_with_consistency_1/')\n", + "interact(plot_mpc, lines=w)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/representative_selector .ipynb b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/representative_selector .ipynb new file mode 100644 index 00000000..32edb00c --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/representative_selector .ipynb @@ -0,0 +1,392 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Use K-medoid algorithm to find the suitable human model representitives" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Imports" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import os, sys\n", + "lib_path = os.path.abspath(os.path.join('..', '..', 'utils'))\n", + "sys.path.append(lib_path)\n", + "from GraphType import GraphStat\n", + "import readCSV as reader\n", + "from scipy import stats\n", + "from ipywidgets import interact, fixed, interactive\n", + "import ipywidgets as widgets\n", + "from pyclustering.cluster.kmedoids import kmedoids\n", + "from pyclustering.utils.metric import distance_metric, type_metric\n", + "import random\n", + "import numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Define a new distance metric" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def ks_value(dest1, dest2):\n", + " value, p = stats.ks_2samp(dest1, dest2)\n", + " return value\n", + "\n", + "\n", + "ks_metric = distance_metric(type_metric.USER_DEFINED, func=ks_value)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Read Human Models" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "304" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Progress Widge\n", + "w = widgets.FloatProgress(\n", + " value=0,\n", + " min=0,\n", + " max=1.0,\n", + " step=0.1,\n", + " description='Loading Files...:',\n", + " bar_style='info',\n", + " orientation='horizontal'\n", + ")\n", + "\n", + "humanFiles = reader.readmultiplefiles('../input/Human/', 1300, False)\n", + "modelToFileName = {}\n", + "for name in humanFiles:\n", + " modelToFileName[GraphStat(name)] = name\n", + "\n", + "models = list(modelToFileName.keys())\n", + "len(humanFiles)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Find Representative by K-medroid for different dists on GraphStat" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Returns the index of the representative" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "def findRep(graphStats, func):\n", + " out_ds = list(map(func, models))\n", + "\n", + " #choose a random starting point\n", + " start_index = random.randint(0, len(out_ds))\n", + "\n", + " # start with one initial metrid [start_index]\n", + " outdegree_kmedoid = kmedoids(out_ds, [start_index], metric=ks_metric)\n", + "\n", + " outdegree_kmedoid.process()\n", + " centoids = outdegree_kmedoid.get_medoids()\n", + " return centoids[0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Find representative for out degree" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### For Yakindumm\n", + "#### For all human models\n", + "* the rep found is ../input/humanOutput\\R_20158_run_1.csv\n", + "* the average distance between it and others is 0.05515988287586802\n", + "\n", + "#### For human models with $100 \\pm 10$ nodes\n", + "* the rep found is ../input/human_output_100\\R_2015225_run_1.csv\n", + "* the average distance between it and others is $0.046150929558524685$\n", + "\n", + "#### for human model with $100 \\pm 10$ nodes and new metric\n", + "* the rep found is ../input/human_output_100\\R_2015248_run_1.csv\n", + "* average distance: 0.052753778714861366\n", + "* median: 0.0468131868131868\n", + "* std: 0.0246917800149673\n", + "* max: 0.15993907083015996\n", + "* min: 0.0" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "../input/Human\\33_run_1.csv\n", + "../input/Human\\33_run_1.csv\n" + ] + } + ], + "source": [ + "od_rep_index = findRep(models, lambda m: m.out_d)\n", + "print(list(modelToFileName.values())[od_rep_index])\n", + "od_rep_model = models[od_rep_index]\n", + "print(modelToFileName[od_rep_model])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "average distance: 0.04615092955852465\n", + "median: 0.04402137483980782\n", + "std: 0.017305709419913242\n", + "max: 0.1411706837186424\n", + "min: 0.0\n" + ] + } + ], + "source": [ + "distances = []\n", + "for model in models:\n", + " distances.append(ks_value(od_rep_model.out_d, model.out_d))\n", + "print('average distance: ', np.mean(distances))\n", + "print('median: ', np.median(distances))\n", + "print('std: ', np.std(distances))\n", + "print('max:', max(distances))\n", + "print('min:', min(distances))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Find Representative for node activities" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### For Yakindumm\n", + "#### For all human models\n", + "* the rep found is ../input/humanOutput\\R_2016176_run_1.csv\n", + "* the average distance between it and others is 0.05275267434589047\n", + "\n", + "#### For human models with $100 \\pm 10$ nodes\n", + "* the rep found is ../input/human_output_100\\R_2017419_run_1.csv\n", + "* the average distance between it and others is $0.04679429311806747$\n", + "\n", + "#### for human model with $100 \\pm 10$ nodes and new metric\n", + "* the rep found is ../input/human_output_100\\R_2017131_run_1.csv\n", + "* average distance: 0.024629205820449567\n", + "* median: 0.023787888564682946\n", + "* std: 0.013845547883198073\n", + "* max: 0.09044674910251294\n", + "* min: 0.0" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "../input/Human\\288_run_1.csv\n", + "../input/Human\\288_run_1.csv\n" + ] + } + ], + "source": [ + "na_rep_index = findRep(models, lambda m: m.na)\n", + "print(list(modelToFileName.values())[na_rep_index])\n", + "na_rep_model = models[na_rep_index]\n", + "print(modelToFileName[na_rep_model])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "average distance: 0.046794293118067494\n", + "median: 0.03898868458274401\n", + "std: 0.02880119213919405\n", + "max: 0.18702970297029703\n", + "min: 0.0\n" + ] + } + ], + "source": [ + "distances = []\n", + "for model in models:\n", + " distances.append(ks_value(na_rep_model.na, model.na))\n", + "print('average distance: ', np.mean(distances))\n", + "print('median: ', np.median(distances))\n", + "print('std: ', np.std(distances))\n", + "print('max:', max(distances))\n", + "print('min:', min(distances))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Find Representative for MPC" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### For Yakindumm\n", + "\n", + "#### For all human models\n", + "* the rep found is ../input/humanOutput\\R_2015246_run_1.csv\n", + "* the average distance between it and others is 0.08556632702185384\n", + "\n", + "#### For human models with $100 \\pm 10$ nodes\n", + "* the rep found is ../input/human_output_100\\R_2016324_run_1.csv\n", + "* the average distance between it and others is $0.07028909225833631$\n", + "\n", + "#### for human model with $100 \\pm 10$ nodes and new metric\n", + "* average distance: 0.054782550772603904\n", + "* median: 0.048330503678551184\n", + "* std: 0.028208257424907526\n", + "* max: 0.21181525241675614\n", + "* min: 0.0" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "../input/Human\\151_run_1.csv\n", + "../input/Human\\151_run_1.csv\n" + ] + } + ], + "source": [ + "mpc_rep_index = findRep(models, lambda m: m.mpc)\n", + "print(list(modelToFileName.values())[mpc_rep_index])\n", + "mpc_rep_model = models[mpc_rep_index]\n", + "print(modelToFileName[mpc_rep_model])" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "average distance: 0.07028909225833632\n", + "median: 0.06254480286738351\n", + "std: 0.037281890512224164\n", + "max: 0.21961550993809065\n", + "min: 0.0\n" + ] + } + ], + "source": [ + "distances = []\n", + "for model in models:\n", + " distances.append(ks_value(mpc_rep_model.mpc, model.mpc))\n", + "print('average distance: ', np.mean(distances))\n", + "print('median: ', np.median(distances))\n", + "print('std: ', np.std(distances))\n", + "print('max:', max(distances))\n", + "print('min:', min(distances))" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Metrics/Metrics-Calculation/metrics_plot/type_analysis/input/.gitignore b/Metrics/Metrics-Calculation/metrics_plot/type_analysis/input/.gitignore new file mode 100644 index 00000000..b3934b01 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/type_analysis/input/.gitignore @@ -0,0 +1,3 @@ +# ignore everything in this folder +* +!.gitignore \ No newline at end of file diff --git a/Metrics/Metrics-Calculation/metrics_plot/type_analysis/src/Node Type Analysis.ipynb b/Metrics/Metrics-Calculation/metrics_plot/type_analysis/src/Node Type Analysis.ipynb new file mode 100644 index 00000000..b4e3432a --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/type_analysis/src/Node Type Analysis.ipynb @@ -0,0 +1,435 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import os, sys\n", + "import glob\n", + "lib_path = os.path.abspath(os.path.join('..', '..', 'utils'))\n", + "sys.path.append(lib_path)\n", + "import matplotlib.pyplot as plt\n", + "from GraphType import GraphStat\n", + "import readCSV as reader\n", + "import constants" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def getModels(folderName, numberOfModels):\n", + " filenames = reader.readmultiplefiles(folderName, numberOfModels, False)\n", + " graphStats = [GraphStat(filename) for filename in filenames]\n", + " return graphStats" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "def drawTypeDistributions(folderName, numberOfModels):\n", + " graphStats = getModels(folderName, numberOfModels)\n", + " typeMap = {}\n", + " keys = set()\n", + " for g in graphStats:\n", + " keys = keys.union(set(g.nodeTypeStat.keys()))\n", + " for key in keys:\n", + " typeMap[key] = [float(g.nodeTypeStat.get(key,0)) for g in graphStats]\n", + " print(list(typeMap.keys()))\n", + " for i, key in enumerate(typeMap.keys()):\n", + " plt.figure(i)\n", + " plt.hist(typeMap[key], range = (0,1), bins=50)\n", + " plt.title(key)\n", + " plt.plot()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['EPackage', 'EAttribute', 'EEnumLiteral', 'EGenericType', 'EAnnotation', 'EOperation', 'EEnum', 'ETypeParameter', 'EParameter', 'EReference', 'EClass', 'EStringToStringMapEntry', 'EDataType']\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAA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/cAd3W3natc87TEv6fsp1vjZMiO+zgHeQe//IXweOH+1a16BMZ8K/C29M2nuAH5itWsec7wfBvYB36J3lH4R8MvAL/e9xu/qvh6fn8T3tZcfkKQGrZVpGUnSMhjuktQgw12SGmS4S1KDDHdJapDhLkkNMtwlqUH/AjaKm/qKXVBpAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEICAYAAABGaK+TAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAATH0lEQVR4nO3df5BlZ13n8feHDDEmhs2vTswmGSaUY5YUJYHtwiC1LDBgBYLMlIZsosKwNTIbV1wVqzSrZSmrVoWtXaNbpoCRIL1bECZEcEbwFw6JKAujExJ+JIFNiCHMZjLTSAYFFAh89497hvT2dM893X3v7X5m3q+qW/f8uvd8n749n37mOfeck6pCktSeJ612AZKk5THAJalRBrgkNcoAl6RGGeCS1CgDXJIaZYBLQJI3J/mVbvoFSfavdk3SMAa41pwkDyX5pyRfnvP43TnrX5CkkvzCvNdt6Javm7PsNUn+etg+q+q6qvr1EdVfSb5nFO8lHYsBrrXqh6rqu+Y8Xjdn3Vbgi93ziiU5aRTvI02aAa6mJDkVuAr4KWBjkuk5qz/UPR/ueu3PBd4MPLebP9y9x9uTvCnJHyf5CvDCbtlvzNvXLyX5Qvc/gh+bs/yOJD8xZ/7bvfwkR2r4eLfPf9ctf3mSu5McTvK/k3zfSH8wOiEZ4GrNjwBfBt4N/Bnw6jnrnt89n9H12j8CXAd8pJs/Y862Pwr8JnA6sNAQy3cD5wAXMOjp70hyybDiqupIDc/s9rkzybOBtwH/ATgbeAuwO8l39GqxtAgDXGvVH3a91SOP13bL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m2cenT5muBt1fVf0/yXOB/dW3+1vjLWzUjza+11gPvc3r+t7dJso7Bf72O9V+Wta7XJQmSvBj4ZeAVVfW1CdU2LsPafDrwDOCOJA8xGCvc3fCBzL6/17uq6htV9XcMLvq2cUL1jUOfNm8DbgWoqo8ApzC46NPxbKSXIFlrAd7n9PzdwNZu+irgg9UdHWjU0DZ3wwlvYRDerY+NwpA2V9WXquqcqtpQVRsYjPu/oqr2rU65K9bn9/oPGRysJsk5DIZUHpxolaPVp80PA5sAkjydQYDPTrTKydsNvLr7NsrlwJeq6sCy3221j9oucpT2/zA4gv3L3bL/wuAfMAw+5HcDDwB/AzxttWueQJv/AjgI3N09dq92zeNu87xt76Dhb6H0/IwD/BZwL/BJ4JrVrnkCbb4U+DCDb6jcDfzgatc8gjbfAhwAvsGgt70NuA64bs7nfFP3M/nkSn+vPZVekhq11oZQJEk9GeCS1CgDXJIaZYBLUqMMcElqlAEuSY0ywCWpUf8PL6yPJS1j+0kAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAR4UlEQVR4nO3de7DcZ13H8feHhrYqlwJNoSaVgEQGdLR0IsbBS6WIbUHSP1qnKNB2IhEExUHUepkRb2N1RoodEY2UIcULrSA0Qr2U0oogqZxKKZSKDbU2Z1Kbo20jWIsUvv6xT3B7epKzJ2f3nOyT92tmZ3+/5/fs/r5P9uSzv31297epKiRJfXnUahcgSRo/w12SOmS4S1KHDHdJ6pDhLkkdMtwlqUOGu7RMSb47yWdXcH+nJ5ldqf1pOhnuOiIkuTPJ/yT5wtDl95Jcm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pcC76iq30nyncA725i/MvnyVsXY82tajtxHOaXBV/skWcPgpdyhXgYd6UY6jUOSFwC/CLykqr64QrVNymJjfizwLcANSe5kMDe5c8rfVB31b/vqqvpSVf0rg5PsbVyh+iZhlDFvBa4CqKqPAcczOMFWr8Z+2pZpCfdRTmmwE7igLZ8LfKjaOxVTatExtymKP2QQ7NM+DwuLjLmq9lfViVW1oao2MHif4SVVNbM65Y7FKH/b72Pw5jlJTmQwTXPHilY5XqOM+S7gDIAkz2IQ7nMrWuXK2gm8on1qZjOwv6ruXtY9rva7yEt4t/ls4F8YvMv+i63tVxn854bBg//nwG7gH4Gnr3bNKzDmDwL3ADe3y87VrnnSY57X9wam/NMyIz7OAd7E4DcRPgWcv9o1r8CYnw18lMEnaW4GXrjaNS9zvH8G3A18icFR+lbgVcCrhh7jt7R/j0+N4+/a0w9IUoemZVpGkrQEhrskdchwl6QOGe6S1CHDXZI6ZLhLUocMd0nq0P8BUMBOFFP0AMIAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAATzklEQVR4nO3df5TldX3f8edLVrQ14PJjoHR3cTVuGq2nKt1jNvXUomtSwcrSU2lJRbZ0cU8sybGxaUuTP5rE5BzMSSUhtSRUlIWoEbHIVomVrFAaLcQlIApoWCmy0wV2DLDRrCZS3v3jflYvs7M7d3dm7ux89vk45577/X6+n+/9vj87s6/7vZ/7vXdSVUiS+vKcxS5AkjT/DHdJ6pDhLkkdMtwlqUOGuyR1yHCXpA4Z7tKIkvxBko2LXYc0CsNdiyrJw0m+k+TbQ7f/3LadluS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BzzO4kuYe4CcXu+Y5jvejwKPA9xicpW8Cfhr46aGf8fvbv8eX5+P32q8fkKQOLZVpGUnSITDcJalDhrskdchwl6QOGe6S1CHDXZI6ZLhLUof+P3GP/9+EMtE5AAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAVeElEQVR4nO3df5BlZX3n8fcn/EzUdRAaC2cmDpoxkbjlSHUIKfcHghUBI4MVsKCMTCjKCVlImTK1BmJlo5uwi6lVUlaIZlxYBqMCaiIjIZsQfpSLJZBGB2RAlhFHGGdkmvAjskQM8N0/7jPx0nRP357bt2f6zPtVdeue85znnvt9+senTz/33HtSVUiSuuUn9nQBkqT5Z7hLUgcZ7pLUQYa7JHWQ4S5JHWS4S1IHGe7SAknyySS/v6fr0L7BcNdeJ8mWJP+c5Km+25/2bT8uSSX5wALWdEWSP5pD/19Pcmt/W1WdW1V/OP/VSS9muGtv9Y6qemnf7fy+bWuAx9q9pGkY7lpUkvwUcBpwHrAyyXjfthXtiH5NkoeSPJrkg33bP5TkmiRXJvlBkk1THv/6JLckeaJtO6W1rwXeDXyg/Rfx5dZ+QZJvt33dm+SdO/cDfBL4pdb/idb+gqP/JO9NsjnJY0k2JHlV37ZKcm6SB5I8nuTSJBnJF1WdZLhrsflV4Cng88DfAmdN0+ffAT8LnAD8lxa2O50CXAUsATYAfwqQ5ADgy8DfAYcDvwV8JsnPVtU64DPAH7f/It7R9vVt4N8DLwc+DPxFkiOq6j7gXOBrrf+SqQUmOR7478C7gCOA77a6+v0K8AvAG1u/tw30FZIw3LX3+lI7gt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K+nF+6TC1rlwtoAnNXOmjkWeLKqtg+1xz39KvIcXm0+Gfi/9F5l/2Br+6/0frmh983/PLAZuAN4zZ6ueQHG/PfAI8DGdtuwp2se9Zin9L2FRX62zIDf5wAfo3c9hG8CZ+zpmhdgzEcBX6V3Js1G4Jf3dM1DjvdzwHbgX+gdpZ8DnAuc2/c9vrR9Pb45Hz/XfvyAJHXQYpmWkSTNgeEuSR1kuEtSBxnuktRBhrskdZDhLkkdZLhLUgf9f3w2oS2zVovyAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAATl0lEQVR4nO3df7Ddd13n8eeLxlIVaFqSdmsSCB2DQ3WG0rkDddgfQNRpi0uqtm4ZtbFGo25lWXFciuy4uj9bd6DSkUGzlDVFKC1VbBaKbC3tgK4tpPYHhYqNtTR3UprbX2FrQe3y3j/O55aT5Cb33Nxz78395PmYOXO+38/3c+73/cm5eZ3v+Zzv+d5UFZKkvjxvqQuQJI2f4S5JHTLcJalDhrskdchwl6QOGe6S1CHDXVpAST6ZZPNS16Fjj+Guo1qSh5J8PcnTQ7ffadvWJvlQkseT/F2SzyX54SWs9TeS/MFwW1WdW1Xbl6omHbsMdy0H/7KqXjB0+6UkJwN/BvwD8L3AKuBK4MNJLhh3AUlWjPtnSgvJcNdy9cvA08CWqvpqVX29qq4F/gvwriQBSFJJ/k2SB5M8luS/J3nu9z7JzyS5P8mTST6V5KVD2yrJpUkeAB5obe9JsjvJ15LcmeSftfZzgF8D/lV7d3FPa78tyc+25ecl+fdJvpJkb5JrkpzYtq1v+9uc5O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cjbK8wzwn4DfAr6xmMUtkFHG/HPAe6vqSYCq2rvINY7bKGMu4EVt+USW+XdlquozwBOH6bIJuKYGbgdWJjltPvtcLuE+0yUN1hyqT1U9C+wDXrwo1S2MUcY8bAuDV/7lbNYxJ3kVsK6qPr6YhS2gUZ7nlwMvT/LnSW5vV11dzkYZ828AP5lkErgJeMvilLZk5vr/fVbL5Y91jHJJg5Eue7CMjDyeJD8JTAD/YkErWniHHXOS5wFXAj+9WAUtglGe5xUMpmZex+Dd2WeTfF9VPbXAtS2UUcb8ZuD3q+pdSb4f+GAb8zcXvrwlMfb8Wi5H7qNc0uC5PklWMHgrd7i3QUe7kS7jkOQHgHcCb6qqv1+k2hbKbGN+IfB9wG1JHmIwN7ljmX+oOurv9o1V9Y9V9bfAlxmE/XI1ypi3ANcDVNVfACcwuMBWr8Z+2ZblEu6jXNJgB7C5LV8AfLraJxXL1KxjblMUv8cg2Jf7PCzMMuaq2ldVq6pqfVWtZ/A5w5uqaufSlDsWo/xu/zGDD89JsorBNM2Di1rleI0y5oeBjQBJXsEg3KcWtcrFtQO4uJ01czawr6oemddPXOpPkefwafN5wF8z+JT9na3tPzL4zw2DJ/+jwC7gc8DpS13zIoz5T4FHgbvbbcdS17zQYz6g720s87NlRnyeA7ybwd9E+AJw0VLXvAhjPgP4cwZn0twN/NBS1zzP8V4LPAL8I4Oj9C3ALwC/MPQcv7f9e3xhHL/XXn5Akjq0XKZlJElzYLhLUocMd0nqkOEuSR0y3CWpQ4a7JHXIcJekDv1/r5fejWS3rgkAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tY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qrWMvie4U1VNbU05Y7FKD/bn2Lw5TlJVjKYprlvolWO1yhjfgA4HSDJyxmE+/REq5ys7cD57ayZDcDeqnpoQe+41N8iz+Pb5rOAbzP4lv09re19DP5yw+DD/3tgJ/AV4CVLXfMExvx54GHg9vbYvtQ1L/aY9+t7M8v8bJkRP+cAH2DwfyLcCZy31DVPYMwnAV9icCbN7cAblrrmBY73E8BDwA8YHKVvBt4BvGPGZ/yh9udx5zh+rr39gCR1aLlMy0iS5sFwl6QOGe6S1CHDXZI6ZLhLUocMd0nqkOEuSR36P3Xci/D7syMLAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAVoklEQVR4nO3df7DddX3n8edLIloVjUBg2ASMbFPrr1VpZOM4W62xVtASOitd/LGkTjSrYsetna3Uzu7abseVzqxu2bXUKKzBrQqyi0REuxhhrK1QgyD+QCVQJHdAchWIWrSKvveP84me3Nybe25y7k3uJ8/HzJnz/X6+n+/5vj+5N6/zzed8vyepKiRJfXnYwS5AkjR+hrskdchwl6QOGe6S1CHDXZI6ZLhLUocMd0nqkOGueZPkziQ/SPL9ocdPh5Z/mOQnQ+tfmed6Jobq+VaSi5M8ej6POQ5J/neStx3sOrS4GO6ab79ZVY8Zejxs9zLwOuBzQ9ueugD1nNaO/WzgOcAfzvUFkiwZe1XzaLHVq/Ew3HVISfKeJOdPaftEkje25Ykkb0lya5L7k1yU5BFDfc9I8sUkDyT5bJKnTXecqtoBfBJ4WtvvNe01v5fk9iSvGXrNF7Z/hbw1ybeA9yY5JsnVSSZbHR9Lsnxon88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7Pm1WM7cR/lKg5/1SbKEwT/l9vXPoEPdSF/jkOSFwB8BZ1TVPy1QbfNltjEfBTwNuC7JnQzmJrcs8g9VR/3dvrKqflxV/wB8nUHYL1ajjHkDcBlAVX0OeCSDL9jq1di/tmWxhPsoX2mwBVjfll8GfLraJxWL1KxjblMU72EQ7It9HhZmGXNV7aqqY6tqZVWtZPA5wxlVte3glDsWo/xuf5TBh+ckOZbBNM0dC1rleI0y5ruAtQBJnswg3CcXtMqFtQU4p101swbYVVX3HNArHuxPkefwafPpwDcYfMr+R63tTxj85YbBD/8jwHbg74GTD3bNCzDmTwH3Aje3x5aDXfN8j3lK3+tY5FfLjPhzDvBOBv8nwpeAsw92zQsw5qcAf8vgSpqbgRcd7JoPcLwfAu4BfszgLH0D8DrgdUM/43e3P48vjeP32q8fkKQOLZZpGUnSHBjuktQhw12SOmS4S1KHDHdJ6pDhLkkdMtwlqUP/HzzJnX+HTdVAAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAATcUlEQVR4nO3df7DldX3f8ecLVkADuiAXSncJK5PVSjOj0h1dx9YYN3EAjbuTgQ5plZVuukmKaTpmmhLT0bapM9hpQmDikG7FZMkkKiVFtgZNyAJDal3iUgigJGElyN5C2av8UIsmAu/+cT6Lh8vdvefee+69ez88HzNnzvf7+b7P+b4/9959ne/5nh+bqkKS1JejlrsBSdL4Ge6S1CHDXZI6ZLhLUocMd0nqkOEuSR0y3CWpQ4a7jkhJHkzynSTfHrr8ZpL3JXmmrX8zyV1J3rXc/c4myboklWTVcveiFwfDXU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ain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEICAYAAABGaK+TAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAQS0lEQVR4nO3da5BlVXnG8f8jIyIi4TINhcOlsYJGY8VLdSFGo0ZINBgdPqCFkWQwU0zU8hI1EaJV0YpJCiwVTcpIJqJODFEIXph4SQSEMiEycUZQBKJcxGEUYVBBvIO8+XA20vZ0T+/p7nO6V8//V9XV56yz9t7v6tM8rF577zOpKiRJ7XnQYhcgSZobA1ySGmWAS1KjDHBJapQBLkmNMsAlqVEGuJatJAcn+VySu5O8fbHrkRbaisUuQEpyM3Aw8PNJzR8ANgPnAD8G7gO+Dryxqj7Rc9frgDuAfcsbHrQMOQPXUvG8qtpn0tcruvbPV9U+wH7APwAfTrJfz30eAVw7l/BO4uRGS54BriZU1X3AB4GHAUfd357kmCT/k+TOJF9K8syu/QPAGuD1SX6Q5LgkD0pyepIbk3wnyflJDuj6jyepJGuTbAU+u7P9d69dluQtSS7vlmk+k2TlpNefNmnbW5Kc0rU/JMnbkmxNcluSs5M8dLg/QS1HBriakGQP4CXAPcA3urZVwCeBvwYOAP4M+EiSsao6BTgXeGs3o78YeBVwAvAM4BHA94B3TznUM4DHAM/e2f4n9f+Drq6DgD27PiQ5HPg08PfAGPAE4KpumzOBR3VtvwqsAv5yXj8g7ZYMcC0VH+9mqvd/ndq1H5PkTuAnwNuAk6vq9u61k4FPVdWnquq+qrqIwbr58TMc408YrKFvq6qfAm8GTpyyXPLmqvphVf245/7fX1Vf6/qfzyCUAV4MXFxVH6qqe6rqO1V1VZIApwKvqarvVtXdwN8CJ83x56bdmOt8WipO6GbJv9AtOVxRVU9Lsg+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qi2oZltjE/HHgccFmSmxmsFW5s+ERm39/rC6vqnqr6OvBVBoHeqj5jXgucD1BVnwf2YvChT8vZgn4EyVIL8D63528E1nSPTwQ+W93ZgUbNOuZuOeEfGYR362ujMMuYq+quqlpZVeNVNc5g3f/5VTW3D5NffH1+rz/O4GQ1SVYyWFK5aaRVLqw+Y94KHAuQ5DEMAnz7SKscvY3AH3VXoxwD3FVVt855b4t91naGs7RfY3AG+41d218x+A8YBm/yvwE3AP8LPHKxax7BmC8GbgOu6r42LnbNwx7zlL6X0fBVKD3f4wDvAK4FrgZOWuyaRzDmxwKXM7hC5Srgdxe75gUY84eAW4F7GMy21wIvBV466X1+d/czuXq+v9feSi9JjVpqSyiSpJ4McElqlAEuSY0ywCWpUQa4JDXKAJekRhngktSo/wfZt4/hpJ7VYAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEICAYAAABGaK+TAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAP+klEQVR4nO3de4zlZ13H8feHllqEQik7rZteGJBF2VQpZCxFErkUSGWxrUnBIpclWdkAYjCQ6CqJAvrHQmIxxCa4WMIK0osV6EpVLEsrSmhh15ZeKNhS1tLspjvQKwi1l69/nN/COjuz85uZc87sM/t+JSfndzvnfJ85Zz7zzHOe3zmpKiRJ7XncchcgSVocA1ySGmWAS1KjDHBJapQBLkmNMsAlqVEGuA5bSSrJs5a7DmmxDHA1LcmuJD9K8oP9Ln/V7Vud5KIke5I8mOSbSd6X5InLXbc0DAa4VoLfqKon7Xd5R5LjgK8ATwBeWFXHAK8AjgV+fjmLlYbFANdK9S7gQeANVbULoKq+W1XvrKobZx6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az4I/HicxY1An/a+Bbiwqu4FqKq9Y65x2Pq0uYAnd8tPYQWcR1JVXwLuOcgh5wB/WwPXAscmWb3YxzvUAvxE4Lv7rd/VbZv1mKp6BLgfeNpYqhuNPm3e3wYGf8FbNm+bkzwPOLmqPjfOwkakz3P8bODZSb6c5NokZ42tutHo0+b3Am9IchfwT8Dvjae0ZbXQ3/eDOtQ+D7zP6fm9TuFvSO/2JHkDMAW8eKQVjd5B25zkccCHgDePq6AR6/McH8lgGOUlDP7D+vckp1bVfSOubVT6tPl1wMer6i+SvBD4RNfmx0Zf3rIZan4daj3wPqfn/+SYJEcy+NfrYP+yHOp6fSRBkpcD7wHOrqqHxlTbqMzX5mOAU4FrkuxiMFa4reE3Mvu+rq+oqoer6jsMPvRtzZjqG4U+bd4AXAZQVV8BjmbwoU8r2VA/guRQC/A+p+dvA9Z3y+cBX6zu3YFGzdvmbjjhrxmEd+tjozBPm6vq/qpaVVWTVTXJYNz/7KrasTzlLlmf1/VnGbxZTZJVDIZU7hhrlcPVp813AmcCJHkOgwCfHmuV47cNeFM3G+UM4P6q2rPoe1vud23neJf2vxi8g/2ebtv7GfwCw+BJ/nvgduCrwDOXu+YxtPkLwN3ADd1l23LXPOo2zzj2GhqehdLzOQ5wAfAN4Cbg/OWueQxtXgt8mcEMlRuAVy53zUNo88XAHuBhBr3tDcBbgbfu9zxf2P1Mblrq69pT6SWpUYfaEIokqScDXJIaZYBLUqMMcElqlAEuSY0ywCWpUQa4JDXq/wCejGt/TvQvcQAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9y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
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAATa0lEQVR4nO3df7DddX3n8edLUnTrD8KPC8MmqZE2dkU7KhPZOM5Wa2wHcTV0BnawUlImbUYLHXfcmZq2f2zd7XSwMy1bti7bKNTgWgVplWixuxhhbV1DDSWCQC2BIrkbSq4Foi7FFn3vH+cTPSQ3uSe5596b+8nzMXPmfL+f7+ec7/uTc/M6n/s5P26qCklSX56z0AVIksbPcJekDhnuktQhw12SOmS4S1KHDHdJ6pDhLkkdMtx1zEvycJJ/TPLtocsfJPmFJN8davu7JH+U5KVHcN8fTvJbI/b99aFzPX3Aue89+hFK42e4a7F4a1W9YOhyRWv/UlW9ADgJeBPwj8CdSV4x7gKq6rf3nx945/5zt8vLx30+aTYMd3Whqr5bVQ9W1S8D/xv4zf3Hknwiyd8n2ZfkC0le3to3Au8AfrXNvj/d2jcleTDJt5Lcl+RnR6khyR8mef8BbZ9NckXbnkzy3iT3J3kiybVJnjvU921JvpLkySR/ORdPUDp+GO7q0Z8C/2Zo/7PAKuB04K+BjwJU1ea2/Ttt9v3W1v/BdvuTgPcB/yPJmSOcdwvwc0meA5DkDOD1wMeH+rwD+OlWz8uBX2t9XwN8EPhF4FTgOuDmJCce0cilxnDXYvGpNqPdf/mlw/TdA5yyf6eqrquqb1XVdxjM6F+Z5KRD3biqPlFVe6rqe1V1A/AAcO5MBVbV/2GwLPT61vR24HNV9Y2hbldX1WRr++3WB2Aj8N+q6svtt5DrWvtrZjqvNB3DXYvFBVW1dOjywcP0XQY8DpDkhCRXtmWWbwIPtz6nHerGSS5NsnP/EwnwisP1P8D1w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OOdSN9jUOSNwG/Abytqr4zT7XNlZnG/ELgFcDtSR5msDa5dZG/qDrqz/bNVfXPVfV3DL5kb9U81TcXRhnzBuBGgKr6EvA8Bl+w1auxf23LYgn3Ub7SYCuwvm1fCHy+2isVi9SMY25LFH/IINgX+zoszDDmqtpXVadV1cqqWsngdYa3VdWOhSl3LEb52f4UgxfPSXIag2Wah+a1yvEaZcyPAGsBkryMQbhPzWuV82srcGl718waYF9VPTqre1zoV5GP4NXm84G/ZfAq+2+0tv/E4D83DB78TwC7gL8CzlromudhzJ8DHgN2tsvWha55rsd8QN/bWeTvlhnxcQ7wewz+JsI9wMULXfM8jPls4IsM3kmzE/iZha55luP9GPAo8M8MZukbgHcC7xx6jD/Q/j3uGcfPtV8/IEkdWizLMpKkI2C4S1KHDHdJ6pDhLkkdMtwlqUOGuyR1yHCXpA79f+8h1Dz9x2woAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "drawTypeDistributions('../input/human/', 1500)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[]\n" + ] + } + ], + "source": [ + "drawTypeDistributions('../input/viatra_75/', 50)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Extract Human Models with size [90, 101]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "def extractModel():\n", + " from shutil import copy\n", + " list_of_files = reader.readmultiplefiles('../input/humanOutput/', 5000)\n", + " num_nodes_list =[]\n", + " human_size_dic = {}\n", + " for file in list_of_files:\n", + " contents = reader.readcsvfile(file)\n", + " num_of_node = contents[constants.NUMBER_NODES]\n", + " # human_size_dic[file] = int(num_of_node[0])\n", + " # num_nodes_list.append(int(num_of_node[0]))\n", + " if 90 <= num_of_node[0] <= 110:\n", + " copy(file, '../input/human_output_100/')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Multinomial Distribution Analysis" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.9999999999999998\n", + "{'EAttribute': 0.23539778449144008, 'EClass': 0.30996978851963747, 'EReference': 0.33081570996978854, 'EPackage': 0.012789526686807653, 'EAnnotation': 0.002517623363544813, 'EEnumLiteral': 0.07275931520644502, 'EEnum': 0.013645518630412891, 'EDataType': 0.004028197381671702, 'EParameter': 0.005941591137965764, 'EGenericType': 0.002014098690835851, 'EOperation': 0.009415911379657605, 'ETypeParameter': 0.0007049345417925478}\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "import scipy.stats as stats\n", + "graphStats = getModels('../input/human_30_500_no_xml/', 1500)\n", + "totalNodes = 0\n", + "typeMap = {}\n", + "for g in graphStats:\n", + " gKeys = g.nodeTypeStat.keys()\n", + " size = g.numNodes[0]\n", + " totalNodes += size\n", + " for key in gKeys:\n", + " curNum = typeMap.get(key, 0)\n", + " typeMap[key] = curNum + float(g.nodeTypeStat[key]) * size\n", + " \n", + "for key in typeMap.keys():\n", + " typeMap[key] /= totalNodes\n", + "print(sum(typeMap.values()))\n", + "print(typeMap)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "def chiSquareMultinomialTest(freq, prob):\n", + " freq = np.array(freq)\n", + " prob = np.array(prob)\n", + " size = sum(freq)\n", + " e = prob * size\n", + " return stats.chisquare(freq, e)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "def typeDistributionTest(g):\n", + " size = g.numNodes[0]\n", + " freq = []\n", + " prob = []\n", + " for key in typeMap.keys():\n", + " value = float(g.nodeTypeStat.get(key, 0))\n", + " freq.append(np.round(value * size))\n", + " prob.append(typeMap[key])\n", + " test = chiSquareMultinomialTest(freq, prob)\n", + " return test" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[7.26359261e+01 6.82490355e-02]\n", + "[3.31848655e+01 1.59841378e-03]\n" + ] + } + ], + "source": [ + "test = [typeDistributionTest(graphStats[i]) for i in range(len(graphStats))]\n", + "print(np.mean(test, 0))\n", + "print(np.median(test, 0))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Node Counts Distribution" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "from shutil import copyfile\n", + "import statistics \n", + "\n", + "graphStats = getModels('../input/human/', 1500)\n", + "sizes = []\n", + "filenames = reader.readmultiplefiles('../input/human/', 1500, False)\n", + "count = 1\n", + "for filename in filenames:\n", + " graphStat = GraphStat(filename)\n", + " size = graphStat.numNodes[0]\n", + " if size >= 30 and size <= 500 and not ('EAnnotation' in graphStat.nodeTypeStat.keys() and 'EStringToStringMapEntry' in graphStat.nodeTypeStat.keys()):\n", + " copyfile(filename, filename.replace('human', 'human_30_500_no_xml'))\n", + " \n", + " \n", + "# for g in graphStats:\n", + "# size = g.numNodes[0]\n", + "# if size >= 30 and size <= 500 and not ('EAnnotation' in g.nodeTypeStat.keys() and 'EStringToStringMapEntry' in g.nodeTypeStat.keys()):\n", + "# sizes.append(g.numNodes[0])\n", + "# print(max(sizes))\n", + "# print(min(sizes))\n", + "# print(statistics.mean(sizes))\n", + "# print(len(sizes))\n", + "# plt.hist(sizes, bins=10)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Metrics/Metrics-Calculation/metrics_plot/type_analysis/src/plot_violation.py b/Metrics/Metrics-Calculation/metrics_plot/type_analysis/src/plot_violation.py new file mode 100644 index 00000000..e5e12f42 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/type_analysis/src/plot_violation.py @@ -0,0 +1,77 @@ +import matplotlib.pyplot as plt +import numpy as np +import cdf_histogram as cdf +import readCSV as reader +import constants +import csv +from shutil import copy + + +# viatra_controlled = np.genfromtxt('../statistics/violations/viatra_controlled.csv', delimiter='\n') +# viatra_controlled_mean = np.mean(viatra_controlled) +# viatra_nocons = np.genfromtxt('../statistics/violations/viatra_no_cons_violation.csv', delimiter='\n') +# viatra_nocons_mean = np.mean(viatra_nocons) +# human = np.genfromtxt('../statistics/violations/human_violation.csv', delimiter='\n') +# human_mean = np.mean(human) +# print('viatra controlled violation mean: ' + str(viatra_controlled_mean)) +# print('viatra no cons violation mean: ' + str(viatra_nocons_mean)) +# print('human output violation mean: ' + str(human_mean)) + + +def read_violation_file(file_name): + violation = {} + with open(file_name) as f: + for i, line in enumerate(f): + line = int(line.rstrip()) + if line in violation: + violation[line] += 1 + else: + violation[line] = 1 + f.close() + return violation + +# violation = read_violation_file('../statistics/violations/viatra_controlled.csv') +# print(violation) +# fig, ax = plt.subplots() +# rects = ax.bar(violation.keys(), violation.values()) +# cdf.autolabel(rects, ax) +# ax.set_title('viatra controlled violation distribution') +# ax.set_xlabel('number of violations') +# ax.set_ylabel('number of occurrence') +# plt.show() +# fig.savefig('../statistics/violations/viatra_controlled_violation_distribution.png') + + +def plot_violation(): + v = np.array([0,1,1,0,0]) + print(v) + (n, bins) = np.histogram(v, bins=v.size, density=True) # NumPy version (no plot) + # plt.plot(.5 * (bins[1:] + bins[:-1]), n) + plt.hist(v, bins=50, density=1) + plt.show() + + +def human_output_size(): + list_of_files = reader.readmultiplefiles('../statistics/humanOutput/', 5000) + num_nodes_list =[] + human_size_dic = {} + for file in list_of_files: + contents = reader.readcsvfile(file) + num_of_node = contents[constants.NUMBER_NODES] + # human_size_dic[file] = int(num_of_node[0]) + # num_nodes_list.append(int(num_of_node[0])) + if 90 <= num_of_node[0] <= 110: + copy(file, '../statistics/human_output_100/') + + # mean = np.mean(num_nodes_list) + # std = np.std(num_nodes_list) + # with open('../statistics/human_output_size.csv', 'w', newline='') as csvfile: + # spamwriter = csv.writer(csvfile, delimiter=',', + # quotechar='|', quoting=csv.QUOTE_MINIMAL) + # spamwriter.writerow(['mean', mean]) + # spamwriter.writerow(['standard deviation', std]) + # for key, value in human_size_dic.items(): + # spamwriter.writerow([key, value]) + + + diff --git a/Metrics/Metrics-Calculation/metrics_plot/utils/DistributionMetrics.py b/Metrics/Metrics-Calculation/metrics_plot/utils/DistributionMetrics.py new file mode 100644 index 00000000..cf532bc5 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/utils/DistributionMetrics.py @@ -0,0 +1,53 @@ +from scipy import stats +from scipy.spatial import distance + +def ks_distance(samples1, samples2): + value, p = stats.ks_2samp(samples1, samples2) + return (value, p) + +def manual_ks(pdf1, pdf2): + result = 0 + sum1 = 0 + sum2 = 0 + for(a, b) in zip(pdf1, pdf2): + sum1 += a + sum2 += b + result = max(result, abs(sum1-sum2)) + return result + +def js_distance(samples1, samples2): + map1 = fromSamples(samples1) + map2 = fromSamples(samples2) + allKeys = set(map1.keys()) | set(map2.keys()) + dist1 = distributionFromMap(map1, allKeys) + dist2 = distributionFromMap(map2, allKeys) + return distance.jensenshannon(dist1, dist2, 2) + +def euclidean_distance(samples1, samples2): + map1 = fromSamples(samples1) + map2 = fromSamples(samples2) + allKeys = set(map1.keys()) | set(map2.keys()) + dist1 = distributionFromMap(map1, allKeys) + dist2 = distributionFromMap(map2, allKeys) + distance = 0 + for i in range(len(dist2)): + distance += pow(dist1[i] - dist2[i], 2) + return pow(distance, 0.5) + +def fromSamples(samples): + m = {} + length = len(samples) + for sample in samples: + value = m.get(sample, 0) + m[sample] = value + 1 + for key in list(m.keys()): + m[key] /= length + return m + +def distributionFromMap(m, allKeys): + dist = [] + for key in allKeys: + value = m.get(key, 0) + dist.append(value) + return dist + diff --git a/Metrics/Metrics-Calculation/metrics_plot/utils/GraphType.py b/Metrics/Metrics-Calculation/metrics_plot/utils/GraphType.py new file mode 100644 index 00000000..48d96ccc --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/utils/GraphType.py @@ -0,0 +1,46 @@ +import readCSV as reader +import constants +import numpy as np + +# graph stats for a collection of graphs +class GraphCollection: + + # init with path contrain files and number of files to read reader is imported from (readCSV) + def __init__(self, path, number, name, shouldShuffle = True): + self.out_ds = [] + self.nas = [] + self.mpcs = [] + self.nts = [] + self.name = name + self.tccs = [] + self.violations = [] + models = reader.readmultiplefiles(path, number, shouldShuffle) + print(len(models)) + self.size = len(models) + for i in range(len(models)): + contents, out_d, na, mpc = reader.getmetrics(models[i]) + self.out_ds.append(out_d) + self.nas.append(na) + self.mpcs.append(mpc) + if(constants.Node_TYPE_KEY in contents): + self.nts.append(contents[constants.Node_TYPE_KEY]) + if(constants.TCC_VALUE in contents): + self.tccs.append(contents[constants.TCC_VALUE]) + if(constants.VIOLATION in contents): + self.violations.append(contents[constants.VIOLATION][0]) + +#Graph stat for one graph +class GraphStat: + # init with teh file name of the stat + def __init__(self, filename): + contents, self.out_d, self.na, self.mpc = reader.getmetrics(filename) + self.numNodes = np.array(contents[constants.NUMBER_NODES]) + if constants.STATE_ID in contents: + self.id = (contents[constants.STATE_ID])[0] + if constants.Node_TYPE_KEY in contents: + self.nodeTypeStat = contents[constants.Node_TYPE_KEY] + if constants.VIOLATION in contents: + self.violations = int(contents[constants.VIOLATION][0]) + if(constants.TCC_VALUE_KEY in contents): + self.tcc = contents[constants.TCC_VALUE_KEY] + diff --git a/Metrics/Metrics-Calculation/metrics_plot/utils/constants.py b/Metrics/Metrics-Calculation/metrics_plot/utils/constants.py new file mode 100644 index 00000000..e30cc583 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/utils/constants.py @@ -0,0 +1,35 @@ +NUMBER_EDGE_TYPES = 'Number of Edge types' + +NUMBER_NODES = 'Number Of Nodes' + +OUT_DEGREE_COUNT = 'OutDegreeCount' + +OUT_DEGREE_VALUE = 'OutDegreeValue' + +NA_COUNT = 'NACount' + +NA_VALUE = 'NAValue' + +MPC_VALUE = 'MPCValue' + +MPC_COUNT = 'MPCCount' + +METAMODEL = 'Meta Mode' + +STATE_ID = 'State Id' + +NODE_TYPE = 'Node Type' + +Node_TYPE_KEY = 'NodeType' + +HUMAN_OUT_D_REP = '../input/humanOutput/R_2015225_run_1.csv' + +HUMAN_MPC_REP = '../input/humanOutput/R_2016324_run_1.csv' + +HUMAN_NA_REP = '../input/humanOutput/R_2017419_run_1.csv' + +VIOLATION = 'violations' + +TCC_VALUE= 'TCCValue' + +TCC_COUNT = 'TCCCount' diff --git a/Metrics/Metrics-Calculation/metrics_plot/utils/readCSV.py b/Metrics/Metrics-Calculation/metrics_plot/utils/readCSV.py new file mode 100644 index 00000000..a56caf45 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/utils/readCSV.py @@ -0,0 +1,186 @@ +import numpy as np +import matplotlib.pyplot as plt +from scipy import stats +import glob +import random +import constants + +# +# read csvfile returns outdegree, node activity, mpc +# as matrix with the first row of values and second row of count +# +def readcsvfile(filename): + + contents = {} + with open(filename) as f: + data = list(f) + f.close() + for i, line in enumerate(data): + arr = line.replace('\n', '').split(',') + # if there is no element in the line, continue + if len(line) < 0: continue + # else check for contents + # if it is MPC then use float + if arr[0] == constants.MPC_VALUE: + contents[constants.MPC_VALUE] = list(map(float, arr[1:])) + # meta models are string + elif(arr[0] == constants.METAMODEL): + contents[constants.METAMODEL] = arr[1:] + # Node types + elif(arr[0] == constants.NODE_TYPE): + types = data[i+1].replace('\n', '').split(',') + numbers = data[i+2].replace('\n', '').split(',') + #convert number to floats + numbers = [float(n) for n in numbers] + contents[constants.Node_TYPE_KEY] = {t : n for t, n in zip(types, numbers)} + elif(arr[0] == constants.TCC_VALUE): + contents[constants.TCC_VALUE] = list(map(float, arr[1:])) + # NA and OD are integers, and store other information as string + else: + try: + contents[arr[0]] = list(map(int, arr[1:])) + except: + contents[arr[0]] = arr[1:] + return contents + +def checkAndReshape(arr): + if len(arr.shape) < 2: + arr = np.reshape(arr, (arr.shape[0],1)) + return arr + +def readTrajectory(filename): + state_codes = [] + with open(filename) as f: + for i, line in enumerate(f): + if(line == ''): continue + state_codes.append(int(line)) + return state_codes +# +# take a matrix as input +# return the sample array +# +def getsample(dataMatrix): + data = [] + value = dataMatrix[0, :] + count = dataMatrix[1, :] + for i, v in enumerate(value): + for x in range(0, int(count[i])): + data.append(v) + return data + +def reproduceSample(values, counts): + arr = np.array([values, counts]) + return getsample(arr) + +# +# take an array of filenames as input +# return the samples of outdegree, na, mpc +# +def getmetrics(filename): + contents = readcsvfile(filename) + outdegree_sample = reproduceSample(contents[constants.OUT_DEGREE_VALUE], contents[constants.OUT_DEGREE_COUNT]) + na_sample = reproduceSample(contents[constants.NA_VALUE], contents[constants.NA_COUNT]) + mpc_sample = reproduceSample(contents[constants.MPC_VALUE], contents[constants.MPC_COUNT]) + + if(constants.TCC_VALUE in contents): + contents[constants.TCC_VALUE] = reproduceSample(contents[constants.TCC_VALUE], contents[constants.TCC_COUNT]) + + return contents,outdegree_sample, na_sample, mpc_sample + +# +# read number of files in the given path RANDOMLY +# +def readmultiplefiles(dirName, maxNumberOfFiles, shouldShuffle = True): + list_of_files = glob.glob(dirName + '*.csv') # create the list of file + if shouldShuffle: + random.shuffle(list_of_files) + #if the number of files is out of bound then just give the whole list + file_names = list_of_files[:maxNumberOfFiles] + # print(file_names) + return file_names + + +def plotlines(x, y, ax): + l1, = ax.plot(x, y) + + +def testgetsamplesfromfiles(): + files = readmultiplefiles('../statistics/viatraOutput/', 2) + for file in files: + getmetrics(file) + +def probability(data): + sum = np.sum(data) + probabilityList = [] + for d in data: + p = d/sum + probabilityList.append(p) + a = np.array(probabilityList) + return a + + +def cumulativeProbability(p): + cdf = np.cumsum(p) + return cdf + + +def plot(): + fig, ax = plt.subplots() + fig, ax1 = plt.subplots() + fig, ax2 = plt.subplots() + fig, ax3 = plt.subplots() + fig, ax4 = plt.subplots() + fig, ax5 = plt.subplots() + list_of_files = readmultiplefiles('../statistics/iatraOutput/') + for file_name in list_of_files: + contents = readcsvfile(file_name) + outdegree = [contents[constants.OUT_DEGREE_VALUE], contents[constants.OUT_DEGREE_COUNT]] + na = [contents[constants.NA_VALUE], contents[constants.NA_COUNT]] + mpc = [contents[constants.MPC_VALUE], contents[constants.MPC_COUNT]] + outV = outdegree[0, :] + outC = outdegree[1, :] + outP = probability(outC) + outCumP = cumulativeProbability(outP) + plotlines(outV, outP, ax) + naV = na[0, :] + naC = na[1, :] + naP = probability(naC) + naCumP = cumulativeProbability(naP) + plotlines(naV, naP, ax1) + mpcV = mpc[0, :] + mpcC = mpc[1, :] + mpcP = probability(mpcC) + mpcCumP = cumulativeProbability(mpcP) + plotlines(mpcV, mpcP, ax2) + plotlines(outV, outCumP, ax3) + plotlines(naV, naCumP, ax4) + plotlines(mpcV, mpcCumP, ax5) + ax.set_xlabel('ourdegree') + ax.set_ylabel('pdf') + ax.grid() + + ax1.set_xlabel('node activity') + ax1.set_ylabel('pdf') + ax1.grid() + + ax2.set_xlabel('multiplex participation coefficient') + ax2.set_ylabel('pdf') + ax2.grid() + + ax3.set_xlabel('ourdegree') + ax3.set_ylabel('cdf') + ax3.grid() + + ax4.set_xlabel('node activity') + ax4.set_ylabel('cdf') + ax4.grid() + + ax5.set_xlabel('multiplex participation coefficient') + ax5.set_ylabel('cdf') + ax5.grid() + + plt.show() + + +# plot() + -- cgit v1.2.3-54-g00ecf