Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Middleware
Commits
27ad974a
Commit
27ad974a
authored
Mar 13, 2019
by
Alexander David Hellwig
Browse files
Fix: npe if affinityPropagation is called without seed
parent
1c45718a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/middleware/clustering/algorithms/AffinityPropagationAlgorithm.java
View file @
27ad974a
...
...
@@ -29,7 +29,7 @@ public class AffinityPropagationAlgorithm implements ClusteringAlgorithm {
RealMatrix
mat
=
new
Array2DRowRealMatrix
(
clusteringInput
.
getAdjacencyMatrix
());
AffinityPropagation
clustering
;
if
(
args
.
length
==
2
&&
args
[
0
]
==
AffinityPropagationBuilder
.
AffinityPropagationParameters
.
SEED
){
if
(
args
!=
null
&&
args
.
length
==
2
&&
args
[
0
]
==
AffinityPropagationBuilder
.
AffinityPropagationParameters
.
SEED
)
{
clustering
=
new
AffinityPropagationParameters
().
setSeed
(
new
Random
((
Long
)
args
[
1
])).
fitNewModel
(
mat
);
}
else
{
clustering
=
new
AffinityPropagationParameters
().
fitNewModel
(
mat
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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