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
-
Field Details
-
neighbors
private final java.util.Map<U extends java.io.Serializable,java.util.Set<U extends java.io.Serializable>> neighborsFor each user, the set of users they are neighbors to see information from. -
initialized
private boolean initializedIndicates if the selections have been initialized or not. -
probRec
private final double probRecProbability of observing a piece of information that comes from a recommended user. -
probTrain
private final double probTrainProbability of observing a piece of information that comes from a training user. -
rng
private final java.util.Random rngRandom number generator -
orientation
Orientation for indicating whih neighbors of the user propagate the information.
-
-
Constructor Details
-
RecommendedSightMechanism
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
-
resetSelections
Description copied from interface:SightMechanism
For each user, this method preconfigures the sight mechanism (for example, selecting a fixed set of users whom each user pays attention to).- Specified by:
resetSelections
in interfaceSightMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P>
- Overrides:
resetSelections
in classIndividualSightMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P>
- Parameters:
data
- the simulation data.
-
seesInformation
Description copied from class:IndividualSightMechanism
Checks if a user sees or not a piece of information.- Specified by:
seesInformation
in classIndividualSightMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P>
- Parameters:
user
- the user.data
- the full data.prop
- the information piece received by a user.- Returns:
- true if the user sees the piece, false if it does not.
-