use of org.vitrivr.cineast.standalone.listener.RetrievalResultListener in project cineast by vitrivr.
the class ContinuousQueryDispatcher method addRetrievalResult.
private void addRetrievalResult(TObjectDoubleMap<String> scoreByObjectId, TObjectDoubleMap<String> scoreBySegmentId, RetrievalTask task, List<ScoreElement> scoreElements) {
if (scoreElements == null) {
LOGGER.warn("Retrieval task {} returned 'null' results.", task);
return;
}
for (RetrievalResultListener listener : resultListeners) {
listener.notify(scoreElements, task);
}
double retrieverWeight = this.retrieverWeights.get(task.getRetriever());
for (ScoreElement element : scoreElements) {
TObjectDoubleMap<String> scoreById;
if (element instanceof ObjectScoreElement) {
scoreById = scoreByObjectId;
} else if (element instanceof SegmentScoreElement) {
scoreById = scoreBySegmentId;
} else if (element instanceof BooleanSegmentScoreElement) {
// TODO: Cleanup?
scoreById = scoreBySegmentId;
} else {
LOGGER.error("Unknown subclass {} of ScoreElement in ContinuousQueryDispatcher.addRetrievalResult.", element.getClass().getSimpleName());
continue;
}
this.addScoreElement(scoreById, element, retrieverWeight);
}
}
Aggregations