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

es.uam.eps.ir.relison.diffusion.propagation.PropagationMechanism 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.propagation;

import es.uam.eps.ir.relison.diffusion.data.Data;
import es.uam.eps.ir.relison.diffusion.data.PropagatedInformation;
import es.uam.eps.ir.relison.diffusion.simulation.UserState;

import java.io.Serializable;
import java.util.stream.Stream;

/**
 * Mechanism for selecting the set of users towards whom each user in the network propagates his/her information
 * pieces.
 *
 * @author Javier Sanz-Cruzado ([email protected])
 * @author Pablo Castells ([email protected])
 *
 * @param  type of the users.
 * @param  type of the items.
 * @param 

type of the parameters. */ public interface PropagationMechanism { /** * Selects the users to which propagate a single piece of information. * @param information the information piece to propagate. * @param originUser the user who propagates the information piece. * @param data the complete data for the simulation. * @return the stream of users to which propagate the single piece of information. */ Stream getUsersToPropagate(PropagatedInformation information, UserState originUser, Data data); /** * It resets the selections that this mechanism did in past iterations. * @param data the data. */ default void resetSelections(Data data){} /** * This indicates whether the selection of the users depends or not on the information piece which we want to * propagate. * @return true if it depends on the information piece, false if it does not. */ boolean dependsOnInformationPiece(); }