Class BatchRecommenderSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P>
java.lang.Object
es.uam.eps.ir.relison.diffusion.selections.AbstractSelectionMechanism<U,I,P>
es.uam.eps.ir.relison.diffusion.selections.CountSelectionMechanism<U,I,P>
es.uam.eps.ir.relison.diffusion.selections.BatchRecommenderSelectionMechanism<U,I,P>
- Type Parameters:
U
- type of the users.I
- type of the information.P
- type of the parameters.
- All Implemented Interfaces:
SelectionMechanism<U,I,P>
public class BatchRecommenderSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P> extends CountSelectionMechanism<U,I,P>
Selects a set of information pieces to propagate depending on the recommendations. When the user has to propagate
information originally owned by other users, it chooses with a given probability information that has arrived from
users who have been recommended to him / whom he has been recommended to. In other case, it propagates information
received from any other neighbor.
The type of neighbor to consider is chosen each iteration, separately.
If information from the selected type of users has not been propagated, then, no further information is prpagated.
When selecting an information piece to propagate, if the information piece has already been propagated, the turn
is skipped.
-
Field Summary
Fields Modifier and Type Field Description private EdgeOrientation
orientation
Neighborhood the information pieces come from.private double
prob
Probability of choosing information to propagate that comes from recommended users. -
Constructor Summary
Constructors Constructor Description BatchRecommenderSelectionMechanism(int numOwn, int numPropagate, double prob, EdgeOrientation orient)
Constructor.BatchRecommenderSelectionMechanism(int numOwn, int numPropagate, int numRepr, double prob, EdgeOrientation orient)
Constructor. -
Method Summary
Modifier and Type Method Description protected java.util.List<PropagatedInformation>
getReceivedInformation(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter, java.lang.Long timestamp)
Obtains the list of received information pieces to repropagate.Methods inherited from class es.uam.eps.ir.relison.diffusion.selections.CountSelectionMechanism
getNumOwn, getNumReceived, getNumRepropagate, getOwnInformation, getPropagatedInformation, getRepropagatedInformation
Methods inherited from class es.uam.eps.ir.relison.diffusion.selections.AbstractSelectionMechanism
getSelectableUsers, select
-
Field Details
-
prob
private final double probProbability of choosing information to propagate that comes from recommended users. If there are enough pieces, each time a piece of information is selected, with probability prob that piece will come from recommended users, and with probability (1-p) the piece will come from an edge in the training graph. -
orientation
Neighborhood the information pieces come from. In case of IN, information comes from the followers of the users. In case of OUT (usual) from the followees. Finally, in case of UND, from any of them.
-
-
Constructor Details
-
BatchRecommenderSelectionMechanism
public BatchRecommenderSelectionMechanism(int numOwn, int numPropagate, double prob, EdgeOrientation orient)Constructor.- Parameters:
numOwn
- number of own information pieces to propagate for each user and iteration.numPropagate
- number of received information to propagate for each user and iteration.prob
- probability of chosing information to propagate that comes from recommended users.orient
- neighborhood where the information pieces come from.
-
BatchRecommenderSelectionMechanism
public BatchRecommenderSelectionMechanism(int numOwn, int numPropagate, int numRepr, double prob, EdgeOrientation orient)Constructor.- Parameters:
numOwn
- number of own information pieces to propagate for each user and iteration.numPropagate
- number of received information to propagate for each user and iteration.numRepr
- number of propagated information pieces to propagate for each user and iterationprob
- probability of chosing information to propagate that comes from recommended users.orient
- neighborhood where the information pieces come from.
-
-
Method Details
-
getReceivedInformation
protected java.util.List<PropagatedInformation> getReceivedInformation(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter, java.lang.Long timestamp)Description copied from class:AbstractSelectionMechanism
Obtains the list of received information pieces to repropagate.- Overrides:
getReceivedInformation
in classCountSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P>
- Parameters:
user
- the user to analyze.data
- the full data.state
- the iteration number.numIter
- number of the iteration.timestamp
- the timestamp for the current simulation.- Returns:
- a selection of the received information pieces to be propagated.
-