Class RecommendedSightMechanism<U extends java.io.Serializable,​I extends java.io.Serializable,​P>

java.lang.Object
es.uam.eps.ir.relison.diffusion.sight.IndividualSightMechanism<U,​I,​P>
es.uam.eps.ir.relison.diffusion.sight.RecommendedSightMechanism<U,​I,​P>
Type Parameters:
U - type of the users.
I - type of the information pieces.
P - type of the parameters.
All Implemented Interfaces:
SightMechanism<U,​I,​P>

public class RecommendedSightMechanism<U extends java.io.Serializable,​I extends java.io.Serializable,​P>
extends IndividualSightMechanism<U,​I,​P>
This mechanism applies two different probabilities: one for observing information pieces from recommended users, and other for observing information pieces from training users.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private boolean initialized
    Indicates if the selections have been initialized or not.
    private java.util.Map<U,​java.util.Set<U>> neighbors
    For each user, the set of users they are neighbors to see information from.
    private EdgeOrientation orientation
    Orientation for indicating whih neighbors of the user propagate the information.
    private double probRec
    Probability of observing a piece of information that comes from a recommended user.
    private double probTrain
    Probability of observing a piece of information that comes from a training user.
    private java.util.Random rng
    Random number generator
  • Constructor Summary

    Constructors 
    Constructor Description
    RecommendedSightMechanism​(double probRec, double probTrain, EdgeOrientation orient)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    void resetSelections​(Data<U,​I,​P> data)
    For each user, this method preconfigures the sight mechanism (for example, selecting a fixed set of users whom each user pays attention to).
    boolean seesInformation​(UserState<U> user, Data<U,​I,​P> data, PropagatedInformation prop)
    Checks if a user sees or not a piece of information.

    Methods inherited from class es.uam.eps.ir.relison.diffusion.sight.IndividualSightMechanism

    seesInformation

    Methods inherited from class java.lang.Object

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

    • neighbors

      private final java.util.Map<U extends java.io.Serializable,​java.util.Set<U extends java.io.Serializable>> neighbors
      For each user, the set of users they are neighbors to see information from.
    • initialized

      private boolean initialized
      Indicates if the selections have been initialized or not.
    • probRec

      private final double probRec
      Probability of observing a piece of information that comes from a recommended user.
    • probTrain

      private final double probTrain
      Probability of observing a piece of information that comes from a training user.
    • rng

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

      private final EdgeOrientation orientation
      Orientation for indicating whih neighbors of the user propagate the information.
  • Constructor Details

    • RecommendedSightMechanism

      public RecommendedSightMechanism​(double probRec, double probTrain, EdgeOrientation orient)
      Constructor.
      Parameters:
      probRec - probability of observing a piece of information that comes from a recommended user.
      probTrain - probability of observing a piece of information that comes from a training user.
      orient - orientation for indicating which neighbors of the user propagate the information.
  • Method Details