Search in sources :

Example 1 with ObjectScoreElement

use of org.vitrivr.cineast.core.data.score.ObjectScoreElement 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);
    }
}
Also used : SegmentScoreElement(org.vitrivr.cineast.core.data.score.SegmentScoreElement) BooleanSegmentScoreElement(org.vitrivr.cineast.core.data.score.BooleanSegmentScoreElement) ScoreElement(org.vitrivr.cineast.core.data.score.ScoreElement) ObjectScoreElement(org.vitrivr.cineast.core.data.score.ObjectScoreElement) SegmentScoreElement(org.vitrivr.cineast.core.data.score.SegmentScoreElement) BooleanSegmentScoreElement(org.vitrivr.cineast.core.data.score.BooleanSegmentScoreElement) RetrievalResultListener(org.vitrivr.cineast.standalone.listener.RetrievalResultListener) BooleanSegmentScoreElement(org.vitrivr.cineast.core.data.score.BooleanSegmentScoreElement) ObjectScoreElement(org.vitrivr.cineast.core.data.score.ObjectScoreElement)

Aggregations

BooleanSegmentScoreElement (org.vitrivr.cineast.core.data.score.BooleanSegmentScoreElement)1 ObjectScoreElement (org.vitrivr.cineast.core.data.score.ObjectScoreElement)1 ScoreElement (org.vitrivr.cineast.core.data.score.ScoreElement)1 SegmentScoreElement (org.vitrivr.cineast.core.data.score.SegmentScoreElement)1 RetrievalResultListener (org.vitrivr.cineast.standalone.listener.RetrievalResultListener)1