Aufgrund einer Wartung wird GitLab am 17.08. zwischen 8:30 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 17.08. between 8:30 and 9:00 am.

Added durration messuring to clustering

parent 2d5e0d61
Pipeline #104362 failed with stages
in 20 minutes and 17 seconds
......@@ -13,19 +13,22 @@ import java.util.Set;
public class ClusteringResult {
Double score = null;
private EMAComponentInstanceSymbol component;
private AlgorithmCliParameters parameters;
private List<Set<EMAComponentInstanceSymbol>> clustering;
private long durration;
private ClusteringResult(EMAComponentInstanceSymbol component, AlgorithmCliParameters parameters, List<Set<EMAComponentInstanceSymbol>> clustering) {
private ClusteringResult(EMAComponentInstanceSymbol component, AlgorithmCliParameters parameters, List<Set<EMAComponentInstanceSymbol>> clustering, long durration) {
this.component = component;
this.parameters = parameters;
this.clustering = clustering;
this.durration = durration;
}
public static ClusteringResult fromParameters(EMAComponentInstanceSymbol component, AlgorithmCliParameters parameters){
long startTime = System.currentTimeMillis();
List<Set<EMAComponentInstanceSymbol>> res = parameters.asClusteringAlgorithm().clusterWithState(component);
return new ClusteringResult(component, parameters, res);
long endTime = System.currentTimeMillis();
return new ClusteringResult(component, parameters, res, endTime - startTime);
}
public double getScore(){
......@@ -51,6 +54,10 @@ public class ClusteringResult {
return clustering.size();
}
private long getDurration() {
return this.durration;
}
public boolean hasNumberOfClusters(int n){
return getNumberOfClusters() == n;
}
......@@ -60,7 +67,8 @@ public class ClusteringResult {
res.setFileName(fileName);
String prefix = "//Algorithm: " + this.getParameters().toString() + "\n" +
"//Number of clusters: " + this.getNumberOfClusters() + "\n" +
"//Score: " + this.getScore() + "\n";
"//Score: " + this.getScore() + "\n" +
"//Durration in ms: " + this.getDurration() + "\n";
String content = MiddlewareTagGenImpl.getFileContent(component, this.clustering);
res.setFileContent(prefix + content);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment