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
1c45718a
Commit
1c45718a
authored
Mar 13, 2019
by
Alexander David Hellwig
Browse files
Cache score if metric is not changed
parent
40c2735c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/middleware/clustering/ClusteringResult.java
View file @
1c45718a
...
...
@@ -29,6 +29,8 @@ public class ClusteringResult {
private
int
componentNumber
;
private
boolean
valid
;
private
Metric
metric
;
private
double
score
;
private
boolean
sameMetric
=
false
;
private
ClusteringResult
(
ClusteringInput
clusteringInput
,
AlgorithmCliParameters
parameters
,
List
<
Set
<
EMAComponentInstanceSymbol
>>
clustering
,
long
duration
,
int
componentNumber
,
boolean
valid
,
Metric
metric
)
{
...
...
@@ -80,11 +82,18 @@ public class ClusteringResult {
}
public
void
setMetric
(
Metric
metric
){
this
.
metric
=
metric
;
if
(
this
.
metric
!=
metric
)
{
this
.
metric
=
metric
;
sameMetric
=
false
;
}
}
public
double
getScore
(){
return
metric
.
getScore
(
this
);
if
(!
sameMetric
)
{
sameMetric
=
true
;
score
=
metric
.
getScore
(
this
);
}
return
score
;
}
public
EMAComponentInstanceSymbol
getComponent
()
{
...
...
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