Class TimestampOrderedSelectionMechanism<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.TimestampOrderedSelectionMechanism<U,I,P>
- Type Parameters:
U
- the type of the users.I
- the type of the information pieces.P
- the type of the features.
- All Implemented Interfaces:
SelectionMechanism<U,I,P>
public class TimestampOrderedSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P> extends CountSelectionMechanism<U,I,P>
Selection mechanism that takes into account the real timestamp of the information pieces to propagate the information owned
by the user. Instead of randomly selecting a fixed number of information pieces, this mechanism selects the oldest
available information.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TimestampOrderedSelectionMechanism(int numOwn, int numPropagate)
Constructor.TimestampOrderedSelectionMechanism(int numOwn, int numPropagate, int numRepropagate)
Constructor. -
Method Summary
Modifier and Type Method Description protected java.util.List<PropagatedInformation>
getOwnInformation(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter, java.lang.Long timestamp)
Obtains the list of own information pieces to repropagate.Methods inherited from class es.uam.eps.ir.relison.diffusion.selections.CountSelectionMechanism
getNumOwn, getNumReceived, getNumRepropagate, getPropagatedInformation, getReceivedInformation, getRepropagatedInformation
Methods inherited from class es.uam.eps.ir.relison.diffusion.selections.AbstractSelectionMechanism
getSelectableUsers, select
-
Constructor Details
-
TimestampOrderedSelectionMechanism
public TimestampOrderedSelectionMechanism(int numOwn, int numPropagate)Constructor.- Parameters:
numOwn
- number of own information pieces to propagate.numPropagate
- number of received information pieces to propagate.
-
TimestampOrderedSelectionMechanism
public TimestampOrderedSelectionMechanism(int numOwn, int numPropagate, int numRepropagate)Constructor.- Parameters:
numOwn
- number of own information pieces to propagate.numPropagate
- number of received information pieces to propagate.numRepropagate
- number of propagated information pieces to repropagate.
-
-
Method Details
-
getOwnInformation
protected java.util.List<PropagatedInformation> getOwnInformation(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 own information pieces to repropagate.- Overrides:
getOwnInformation
in classCountSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P>
- Parameters:
user
- the user to analyze.data
- the full data.state
- current simulation state.numIter
- the iteration number.timestamp
- the timestamp for the current simulation.- Returns:
- a selection of the own information pieces to be propagated.
-