es.uam.eps.ir.relison.diffusion.protocols.ProportionThresholdModelProtocol Maven / Gradle / Ivy
The newest version!
/*
* Copyright (C) 2020 Information Retrieval Group at Universidad Aut�noma
* de Madrid, http://ir.ii.uam.es
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package es.uam.eps.ir.relison.diffusion.protocols;
import es.uam.eps.ir.relison.diffusion.expiration.AllNotPropagatedExpirationMechanism;
import es.uam.eps.ir.relison.diffusion.propagation.AllNeighborsPropagationMechanism;
import es.uam.eps.ir.relison.diffusion.selections.ProportionThresholdSelectionMechanism;
import es.uam.eps.ir.relison.diffusion.sight.AllNotPropagatedSightMechanism;
import es.uam.eps.ir.relison.diffusion.update.MergerUpdateMechanism;
import es.uam.eps.ir.relison.graph.edges.EdgeOrientation;
import java.io.Serializable;
/**
* Threshold model protocol.
*
* Main characteristics
*
* - Selection mechanism: Each user takes a fixed number of information pieces from his own list. In the case of the
* received list, each piece of information will be propagated depending on the proportion of the neighbors that has propagated
* the information to him. If this proportion exceeds a threshold, then, the information will be propagated.
* - Expiration mechanism: In this case, information pieces never expire: they will not be discarded.
* - Update mechanism: Since information pieces remain "in the memory of the users" once they are received, if a piece
* is received again, the list of users will be updated to contain the whole lot of users that have propagated the piece to the
* corresponding user
* - Propagation mechanism: In order to maximize the spreading, the information reaches all the followers of the user that
* propagates the information
* - Sight mechanism: All users see all the received information pieces.
*
*
* @author Javier Sanz-Cruzado ([email protected])
* @author Pablo Castells ([email protected])
*
*
* Reference: D. Kempe, J. Kleinberg, and E. Tardos. Maximizing the spread of influence through a social network, KDD 2003, pp. 137–146 (2003).
*
*
* @param Type of the users.
* @param Type of the information pieces.
* @param Type of the parameters.
*/
public class ProportionThresholdModelProtocol extends Protocol
{
/**
* Constructor.
* @param numOwn number of own pieces to propagate each iteration.
* @param numRec number of pieces to repropagate.
* @param threshold threshold that has to be surpassed.
*/
public ProportionThresholdModelProtocol(int numOwn, int numRec, double threshold)
{
super(new ProportionThresholdSelectionMechanism<>(numOwn, threshold, EdgeOrientation.OUT),
new AllNotPropagatedExpirationMechanism<>(),
new MergerUpdateMechanism(),
new AllNeighborsPropagationMechanism<>(EdgeOrientation.IN),
new AllNotPropagatedSightMechanism<>());
}
}