Class AbstractSelectionMechanism<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>
- 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>
- Direct Known Subclasses:
 CountSelectionMechanism,TimestampBasedSelectionMechanism
public abstract class AbstractSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P> extends java.lang.Object implements SelectionMechanism<U,I,P>
Abstract implementation of a selection mechanism.
- 
Constructor Summary
Constructors Constructor Description AbstractSelectionMechanism() - 
Method Summary
Modifier and Type Method Description protected abstract 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.protected abstract 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.protected abstract java.util.List<PropagatedInformation>getRepropagatedInformation(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter, java.lang.Long timestamp)Obtains the list of propagated 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.Selectionselect(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter, java.lang.Long timestamp)Given a user, selects the information pieces that he/she propagates during this iteration. 
- 
Constructor Details
- 
AbstractSelectionMechanism
public AbstractSelectionMechanism() 
 - 
 - 
Method Details
- 
select
public Selection select(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter, java.lang.Long timestamp)Description copied from interface:SelectionMechanismGiven a user, selects the information pieces that he/she propagates during this iteration.- Specified by:
 selectin interfaceSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P>- Parameters:
 user- the user to analyze.data- the complete data.state- the current state of the simulation.numIter- the iteration number.timestamp- the current timestamp.- Returns:
 - a selection of information pieces to be propagated.
 
 - 
getOwnInformation
protected abstract 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.- 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.
 
 - 
getReceivedInformation
protected abstract 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.- 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.
 
 - 
getRepropagatedInformation
protected abstract java.util.List<PropagatedInformation> getRepropagatedInformation(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter, java.lang.Long timestamp)Obtains the list of propagated information pieces to repropagate.- Parameters:
 user- the user to analyze.data- the full data.state- current simulation state.numIter- number of the iteration.timestamp- the timestamp for the current simulation.- Returns:
 - a selection of the information pieces to repropagate.
 
 - 
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:SelectionMechanismSelects the users which can propagate information during the iteration.- Specified by:
 getSelectableUsersin interfaceSelectionMechanism<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.
 
 
 -