Class LinearAggregator

  • All Implemented Interfaces:
    Scorer, FlyweightPrototype<Scorer>

    public class LinearAggregator
    extends AbstractAggregator
    An aggregator that computes a linear combination of the component scorers.

    This class requires, beside the usually array of scorers, a parallel array of weights (not to be confused with index weights). The score from each scorer will be multiplied by the respective weight, and the overal score will be the sum of these values. Equalisation, if necessary, if performed by maximising over the sample scores and dividing all scores by the resulting value.

    • Field Detail

      • weight

        protected final double[] weight
        The weights of each scorer.
      • equalisationFactor

        protected final double[] equalisationFactor
        The equalisation factors for each scorer (all set to one if no equalisation is required).
    • Constructor Detail

      • LinearAggregator

        public LinearAggregator​(Scorer[] scorer,
                                double[] weight)
        Creates a linear aggregator.
        Parameters:
        scorer - the array of scorers.
        weight - the array of weights.