Class RandomFiller<U,​I>

java.lang.Object
es.uam.eps.ir.relison.links.recommendation.filler.AbstractFastFiller<U,​I>
es.uam.eps.ir.relison.links.recommendation.filler.RandomFiller<U,​I>
Type Parameters:
U - type of the users.
I - type of the items.
All Implemented Interfaces:
FastFiller<U,​I>, Filler<U,​I>

public class RandomFiller<U,​I>
extends AbstractFastFiller<U,​I>
Filler that completes ranking with random recommendation.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.util.List<java.lang.Integer> order
    A list containing the selected order for the items.
    private java.util.Random rng
    Random number generator.

    Fields inherited from class es.uam.eps.ir.relison.links.recommendation.filler.AbstractFastFiller

    prefData
  • Constructor Summary

    Constructors 
    Constructor Description
    RandomFiller​(es.uam.eps.ir.ranksys.fast.preference.FastPreferenceData<U,​I> prefData)
    Constructor.
    RandomFiller​(es.uam.eps.ir.ranksys.fast.preference.FastPreferenceData<U,​I> prefData, long seed)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    java.util.stream.IntStream fillerList​(int uidx)
    Returns a list with the identifiers of the items.
    java.util.stream.Stream<I> fillerList​(U u)
    Obtains the filler list for a given user.
    protected void resetMethod()
    Resets the variables corresponding to the filler.

    Methods inherited from class es.uam.eps.ir.relison.links.recommendation.filler.AbstractFastFiller

    fastFill, fill, numFilled, numTotal, reset

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • rng

      private final java.util.Random rng
      Random number generator.
    • order

      private final java.util.List<java.lang.Integer> order
      A list containing the selected order for the items.
  • Constructor Details

    • RandomFiller

      public RandomFiller​(es.uam.eps.ir.ranksys.fast.preference.FastPreferenceData<U,​I> prefData, long seed)
      Constructor.
      Parameters:
      prefData - preference data.
      seed - random number generator seed.
    • RandomFiller

      public RandomFiller​(es.uam.eps.ir.ranksys.fast.preference.FastPreferenceData<U,​I> prefData)
      Constructor.
      Parameters:
      prefData - preference data.
  • Method Details

    • resetMethod

      protected void resetMethod()
      Description copied from class: AbstractFastFiller
      Resets the variables corresponding to the filler.
      Specified by:
      resetMethod in class AbstractFastFiller<U,​I>
    • fillerList

      public java.util.stream.IntStream fillerList​(int uidx)
      Description copied from interface: FastFiller
      Returns a list with the identifiers of the items.
      Parameters:
      uidx - the identifier of the user.
      Returns:
      a stream with the identifiers of the items used to fill lists for the user uidx
    • fillerList

      public java.util.stream.Stream<I> fillerList​(U u)
      Description copied from interface: Filler
      Obtains the filler list for a given user.
      Parameters:
      u - the user.
      Returns:
      a stream containing the filler list for the user.