Commit 1eff65ac authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Fixed bug to enable CorrectInformationRatio metric

parent 27422176
......@@ -82,23 +82,28 @@ implements CachingComponent, ConnectivityListener {
return null;
}
Map<Object, List<PointInformation>> similarCacheEntries = new HashMap<>();
Map<Object, Map<Class<? extends Object>, List<PointInformation>>> similarCacheEntries = new HashMap<>();
for (T t : cacheEntries) {
Object position = getEdgeOrPosition(t);
if (!similarCacheEntries.containsKey(position)) {
similarCacheEntries.put(position, new ArrayList<>());
similarCacheEntries.put(position, new HashMap<>());
}
similarCacheEntries.get(position).add(t);
if (!similarCacheEntries.get(position).containsKey(t.getValue().getClass())) {
similarCacheEntries.get(position).put(t.getValue().getClass(), new ArrayList<PointInformation>());
}
similarCacheEntries.get(position).get(t.getValue().getClass()).add(t);
}
List<T> decidedInformation = new ArrayList<>();
for (List<PointInformation> similarEntries : similarCacheEntries
for (Map<Class<? extends Object>, List<PointInformation>> similarEdges : similarCacheEntries
.values()) {
PointInformation correctInformation = _decisionStrategy
.decideOnCorrectInformation(similarEntries);
decidedInformation.add((T) correctInformation);
for (List<PointInformation> similarInformation : similarEdges.values()) {
PointInformation correctInformation = _decisionStrategy
.decideOnCorrectInformation(similarInformation);
decidedInformation.add((T) correctInformation);
}
}
return decidedInformation;
......
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