Class IndependentCascadeModelSelectionMechanism<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.IndependentCascadeModelSelectionMechanism<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 IndependentCascadeModelSelectionMechanism<U extends java.io.Serializable,I extends java.io.Serializable,P> extends CountSelectionMechanism<U,I,P>
Selects the information pieces to propagate according to the independent cascade protocol, i.e. given an information
piece received by a user, it propagates it with a probability that only depends on the endpoints of the link.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description IndependentCascadeModelSelectionMechanism(double prob, int numOwn)
Constructor.IndependentCascadeModelSelectionMechanism(double prob, int numOwn, int numRepr)
Constructor.IndependentCascadeModelSelectionMechanism(Graph<U> graph, int numOwn, int numRepr, EdgeOrientation orient)
Constructor.IndependentCascadeModelSelectionMechanism(Graph<U> graph, int numOwn, 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.protected java.util.List<PropagatedInformation>
getReceivedInformationGraph(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter)
Using a weighted graph (where the weights represent diffusion probabilities), it obtains the list of received information pieces that we want to propagate.protected java.util.List<PropagatedInformation>
getReceivedInformationProb(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter)
Given a fixed value for the probability, it obtains the list of 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
-
Constructor Details
-
IndependentCascadeModelSelectionMechanism
public IndependentCascadeModelSelectionMechanism(double prob, int numOwn)Constructor.- Parameters:
prob
- probability that each information piece is selected.numOwn
- number of own pieces of information to propagate.
-
IndependentCascadeModelSelectionMechanism
public IndependentCascadeModelSelectionMechanism(double prob, int numOwn, int numRepr)Constructor.- Parameters:
prob
- probability that each information piece is selected.numOwn
- number of own pieces of information to propagate.numRepr
- number of propagated pieces to repropagate.
-
IndependentCascadeModelSelectionMechanism
public IndependentCascadeModelSelectionMechanism(Graph<U> graph, int numOwn, EdgeOrientation orient)Constructor.- Parameters:
graph
- a weighted graph containing the probabilities of spreading information between users in the network.numOwn
- number of own pieces of information to propagate.orient
- neighborhood where the information pieces come from.
-
IndependentCascadeModelSelectionMechanism
public IndependentCascadeModelSelectionMechanism(Graph<U> graph, int numOwn, int numRepr, EdgeOrientation orient)Constructor.- Parameters:
graph
- a weighted graph containing the probabilities of spreading information between users in a graph.numOwn
- number of own pieces of information to propagate.numRepr
- number of propagated pieces to repropagate.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.
-
getReceivedInformationGraph
protected java.util.List<PropagatedInformation> getReceivedInformationGraph(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter)Using a weighted graph (where the weights represent diffusion probabilities), it obtains the list of received information pieces that we want to propagate.- Parameters:
user
- the user propagating the information.data
- the data for the simulation.state
- the current state of the simulation.numIter
- the number of the current iteration.- Returns:
- a selection of information pieces to be propagated
-
getReceivedInformationProb
protected java.util.List<PropagatedInformation> getReceivedInformationProb(UserState<U> user, Data<U,I,P> data, SimulationState<U,I,P> state, int numIter)Given a fixed value for the probability, it obtains the list of pieces to repropagate.- Parameters:
user
- the user to analyzedata
- the full datastate
- current simulation statenumIter
- number of the iteration- Returns:
- a selection of the received tweets to be propagated
-