Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
EMAM2Middleware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Middleware
Commits
e124d95f
Commit
e124d95f
authored
Feb 13, 2019
by
Alexander David Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Costs between components did not get added, Added test case to confirm
parent
b6cebda6
Pipeline
#104730
failed with stages
in 23 minutes and 28 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
2 deletions
+57
-2
src/main/java/de/monticore/lang/monticar/generator/middleware/clustering/AutomaticClusteringHelper.java
...ator/middleware/clustering/AutomaticClusteringHelper.java
+2
-2
src/test/java/de/monticore/lang/monticar/generator/middleware/AutomaticClusteringTest.java
...onticar/generator/middleware/AutomaticClusteringTest.java
+25
-0
src/test/resources/lab/AdjMatrixComp.emam
src/test/resources/lab/AdjMatrixComp.emam
+30
-0
No files found.
src/main/java/de/monticore/lang/monticar/generator/middleware/clustering/AutomaticClusteringHelper.java
View file @
e124d95f
...
...
@@ -35,8 +35,8 @@ public class AutomaticClusteringHelper {
int
index1
=
subcompLabels
.
get
(
sourceCompOpt
.
getFullName
());
int
index2
=
subcompLabels
.
get
(
targetCompOpt
.
getFullName
());
res
[
index1
][
index2
]
=
getTypeCostHeuristic
(
con
.
getSourcePort
());
res
[
index2
][
index1
]
=
getTypeCostHeuristic
(
con
.
getSourcePort
());
res
[
index1
][
index2
]
+
=
getTypeCostHeuristic
(
con
.
getSourcePort
());
res
[
index2
][
index1
]
+
=
getTypeCostHeuristic
(
con
.
getSourcePort
());
});
...
...
src/test/java/de/monticore/lang/monticar/generator/middleware/AutomaticClusteringTest.java
View file @
e124d95f
...
...
@@ -96,6 +96,31 @@ public class AutomaticClusteringTest extends AbstractSymtabTest{
}
}
@Test
public
void
testAdjacencyMatrixCreation2
(){
TaggingResolver
taggingResolver
=
AbstractSymtabTest
.
createSymTabAndTaggingResolver
(
TEST_PATH
);
EMAComponentInstanceSymbol
componentInstanceSymbol
=
taggingResolver
.<
EMAComponentInstanceSymbol
>
resolve
(
"lab.adjMatrixComp"
,
EMAComponentInstanceSymbol
.
KIND
).
orElse
(
null
);
assertNotNull
(
componentInstanceSymbol
);
List
<
EMAComponentInstanceSymbol
>
subcompsOrderedByName
=
ComponentHelper
.
getSubcompsOrderedByName
(
componentInstanceSymbol
);
double
[][]
matrix
=
AutomaticClusteringHelper
.
createAdjacencyMatrix
(
subcompsOrderedByName
,
ComponentHelper
.
getInnerConnectors
(
componentInstanceSymbol
),
ComponentHelper
.
getLabelsForSubcomps
(
subcompsOrderedByName
));
//sorted full name: sub1, sub2, sub3
double
[][]
expRes
=
{{
0
,
10
,
20
}
//sub1
,{
10
,
0
,
0
}
//sub2
,{
20
,
0
,
0
}};
//sub3
for
(
int
i
=
0
;
i
<
expRes
.
length
;
i
++){
for
(
int
j
=
0
;
j
<
expRes
[
i
].
length
;
j
++){
assertTrue
(
expRes
[
i
][
j
]
==
matrix
[
i
][
j
]);
}
}
}
@Test
public
void
testSpectralClustering
(){
...
...
src/test/resources/lab/AdjMatrixComp.emam
0 → 100644
View file @
e124d95f
package
lab
;
component
AdjMatrixComp
{
component
Sub1
{
ports
out
Q
qOut1
,
out
Q
qOut2
,
out
Q
qOut3
;
}
component
Sub2
{
ports
in
Q
qIn
;
}
component
Sub3
{
ports
in
Q
qIn1
,
in
Q
qIn2
;
}
instance
Sub1
sub1
;
instance
Sub2
sub2
;
instance
Sub3
sub3
;
connect
sub1
.
qOut1
->
sub2
.
qIn
;
connect
sub1
.
qOut2
->
sub3
.
qIn1
;
connect
sub1
.
qOut3
->
sub3
.
qIn2
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment