Class MultiEvaluator<InputType, OutputType>
java.lang.Object
fr.inria.rules.integraal.component_builder.evaluators.generic.MultiEvaluator<InputType, OutputType>
- Type Parameters:
InputType- the type of elements to evaluateOutputType- the type produced for each input
- Direct Known Subclasses:
CountingQueryEvaluatorWithMultiEvaluator, QueryEvaluatorWithMultiEvaluator, QueryRewriterWitMultiEvaluator
Shared base for batch and lazy evaluators running on collections of inputs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.slf4j.LoggerLogger shared by multi-evaluator implementations. -
Constructor Summary
ConstructorsConstructorDescriptionMultiEvaluator(Collection<InputType> input, Function<InputType, OutputType> function, ExternalAlgorithmHaltingConditions externalHaltingConditions, BiFunction<InputType, String, OutputType> outputIfTimeout) Creates an evaluator using the same function for batch and lazy execution.MultiEvaluator(Collection<InputType> input, Function<InputType, OutputType> batchFunction, Function<InputType, OutputType> lazyFunction, ExternalAlgorithmHaltingConditions externalHaltingConditions, BiFunction<InputType, String, OutputType> outputIfTimeout) Creates an evaluator with distinct batch and lazy functions. -
Method Summary
Modifier and TypeMethodDescriptionfinal Iterable<OutputType> Evaluates all queries in a batch and returns a list of QueryEvaluationOutput.final Iterable<OutputType> Provides lazy evaluation for the queries, yielding QueryEvaluationOutput for each query.
-
Field Details
-
LOG
protected static org.slf4j.Logger LOGLogger shared by multi-evaluator implementations.
-
-
Constructor Details
-
MultiEvaluator
public MultiEvaluator(Collection<InputType> input, Function<InputType, OutputType> function, ExternalAlgorithmHaltingConditions externalHaltingConditions, BiFunction<InputType, String, OutputType> outputIfTimeout) Creates an evaluator using the same function for batch and lazy execution.- Parameters:
input- the inputs to evaluatefunction- the evaluation function used in both modesexternalHaltingConditions- the external stop conditions to observeoutputIfTimeout- the fallback result producer when a timeout occurs
-
MultiEvaluator
public MultiEvaluator(Collection<InputType> input, Function<InputType, OutputType> batchFunction, Function<InputType, OutputType> lazyFunction, ExternalAlgorithmHaltingConditions externalHaltingConditions, BiFunction<InputType, String, OutputType> outputIfTimeout) Creates an evaluator with distinct batch and lazy functions.- Parameters:
input- the inputs to evaluatebatchFunction- the function used for batch processinglazyFunction- the function used for lazy processingexternalHaltingConditions- the external stop conditions to observeoutputIfTimeout- the fallback result producer when a timeout occurs
-
-
Method Details
-
batchEvaluate
Evaluates all queries in a batch and returns a list of QueryEvaluationOutput.- Returns:
- A list of QueryEvaluationOutput, each containing a query and its corresponding iterator of substitutions.
-
lazyEvaluate
Provides lazy evaluation for the queries, yielding QueryEvaluationOutput for each query.- Returns:
- An iterable for lazy evaluation of query results, each as a QueryEvaluationOutput.
-