Interface SimCalculatorStrategy
-
- All Known Implementing Classes:
SimCalculatorRetrieverStrategy,SimCalculatorSingleStrategy
public interface SimCalculatorStrategyThis strategy determines the way similarities are computed for the similarity cache.- Author:
- Maximilian Hoffmann
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggerloggerConstantlogger
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description longcomputeSimilarities(DecimalFormat df, WriteableObjectPool queryPool, WriteableObjectPool casePool, AbstractSimilarityCacheMatrix similarityMatrix)Computes the similarities according to the strategy.default voidprintProgressAndEstimation(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.
-
-
-
Method Detail
-
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
-
-