Interface SimCalculatorStrategy
- All Known Implementing Classes:
SimCalculatorRetrieverStrategy
,SimCalculatorSingleStrategy
public interface SimCalculatorStrategy
This strategy determines the way similarities are computed for the similarity cache.
- Author:
- Maximilian Hoffmann
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
computeSimilarities
(DecimalFormat df, WriteableObjectPool queryPool, WriteableObjectPool casePool, AbstractSimilarityCacheMatrix similarityMatrix) Computes the similarities according to the strategy.default void
printProgressAndEstimation
(int currNumComputation, String descriptionStr, int totNumComputations, long currTime, String compType, int stepsMade, long passedTime) Prints the progress of the current computation, either with or without a retriever.
-
Field Details
-
logger
static final org.slf4j.Logger loggerConstantlogger
-
-
Method Details
-
printProgressAndEstimation
default void printProgressAndEstimation(int currNumComputation, String descriptionStr, int totNumComputations, long currTime, String compType, int stepsMade, long passedTime) Prints the progress of the current computation, either with or without a retriever.- Parameters:
currNumComputation
- the number of the current computationdescriptionStr
- the descriptive text of this computation steptotNumComputations
- the total number of computationscurrTime
- the current time in millisecondscompType
- the type of computation to printstepsMade
- the number of steps madepassedTime
- the already passed time in milliseconds
-
computeSimilarities
long computeSimilarities(DecimalFormat df, WriteableObjectPool queryPool, WriteableObjectPool casePool, AbstractSimilarityCacheMatrix similarityMatrix) Computes the similarities according to the strategy. Thereby, the implementation should use the given methods of this interface to enable printing of the progress and utilizing the cache functionality.- Parameters:
df
- the decimal format to usequeryPool
- Pool of queriescasePool
- Pool of casessimilarityMatrix
- the similarity matrix to fill- Returns:
- the overall time the procedure ran
-