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 Details

    • graph

      private final Graph<U extends java.io.Serializable> graph
      Weighted graph. The weights represent the probability that an information piece proceeding of a certain node is spread by the node that has received.
    • prob

      private final double prob
      Uniform probability.
    • orient

      private final EdgeOrientation orient
      Neighborhood where the information pieces come from.
  • 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 class CountSelectionMechanism<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 analyze
      data - the full data
      state - current simulation state
      numIter - number of the iteration
      Returns:
      a selection of the received tweets to be propagated