Class PureTimestampBasedSelectionMechanism<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.TimestampBasedSelectionMechanism<U,I,P>
es.uam.eps.ir.relison.diffusion.selections.PureTimestampBasedSelectionMechanism<U,I,P>
- Type Parameters:
U
- type of the users.I
- type of the information pieces.P
- type of the parameters.
- All Implemented Interfaces:
SelectionMechanism<U,I,P>
public class PureTimestampBasedSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P> extends TimestampBasedSelectionMechanism<U,I,P>
Selection mechanism that takes the real timestamps of the users into account. Each own piece of information
is released when the timestamp of the piece is equal to the timestamp of the simulation. No information pieces
are repropagated.
-
Constructor Summary
Constructors Constructor Description PureTimestampBasedSelectionMechanism()
-
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.java.util.stream.Stream<U>
getSelectableUsers(Data<U,I,P> data, SimulationState<U,I,P> state, int numIter, java.lang.Long timestamp)
Selects the users which can propagate information during the iteration.Methods inherited from class es.uam.eps.ir.relison.diffusion.selections.TimestampBasedSelectionMechanism
getOwnInformation, getRepropagatedInformation
Methods inherited from class es.uam.eps.ir.relison.diffusion.selections.AbstractSelectionMechanism
select
-
Constructor Details
-
PureTimestampBasedSelectionMechanism
public PureTimestampBasedSelectionMechanism()
-
-
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.- Specified by:
getReceivedInformation
in classAbstractSelectionMechanism<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.
-
getSelectableUsers
public java.util.stream.Stream<U> getSelectableUsers(Data<U,I,P> data, SimulationState<U,I,P> state, int numIter, java.lang.Long timestamp)Description copied from interface:SelectionMechanism
Selects the users which can propagate information during the iteration.- Specified by:
getSelectableUsers
in interfaceSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P>
- Overrides:
getSelectableUsers
in classAbstractSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P>
- Parameters:
data
- the complete data.state
- the current state of the simulation.numIter
- iteration number.timestamp
- the current timestamp.- Returns:
- a stream containing the users who can propagate information.
-