All Downloads are FREE. Search and download functionalities are using the official Maven repository.

es.uam.eps.ir.relison.diffusion.protocols.CountThresholdModelProtocol 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.InfiniteTimeExpirationMechanism;
import es.uam.eps.ir.relison.diffusion.propagation.AllNeighborsPropagationMechanism;
import es.uam.eps.ir.relison.diffusion.selections.CountThresholdSelectionMechanism;
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;

/**
 * Count 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 number of * the neighbors that have propagated the information to him. If this proportion exceeds a number (or there * are not enough neighbors), 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]) * * @param type of the users. * @param type of the information pieces. * @param type of the user and information pieces features. */ public class CountThresholdModelProtocol extends Protocol { /** * Constructor. * @param numOwn number of own pieces to propagate each iteration. * @param threshold threshold that has to be surpassed. */ public CountThresholdModelProtocol(int numOwn, int threshold) { super(new CountThresholdSelectionMechanism<>(numOwn, threshold), new InfiniteTimeExpirationMechanism<>(), new MergerUpdateMechanism(), new AllNeighborsPropagationMechanism<>(EdgeOrientation.IN), new AllNotPropagatedSightMechanism<>()); } }