Class CreatorGlobalEntropy<U extends java.io.Serializable,I extends java.io.Serializable,F>
java.lang.Object
es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric<U,I,F>
es.uam.eps.ir.relison.diffusion.metrics.creator.global.CreatorGlobalEntropy<U,I,F>
- Type Parameters:
U- type of the user.I- type of the information.F- type of the features.
- All Implemented Interfaces:
GlobalSimulationMetric<U,I,F>,SimulationMetric<U,I,F>
public class CreatorGlobalEntropy<U extends java.io.Serializable,I extends java.io.Serializable,F> extends AbstractGlobalSimulationMetric<U,I,F>
Computes the entropy over the set of users in the network. For each user, the value is the number
of created pieces which have been received by other users.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<U,java.lang.Double>counterSpeed value.private static java.lang.StringENTROPYName fixed value.private doublesumNumber of creators of the received tweets.private booleanuniqueIndicates if a piece of information is considered once (or each time it appears if false).Fields inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric
data, initialized -
Constructor Summary
Constructors Constructor Description CreatorGlobalEntropy(boolean unique)Constructor. -
Method Summary
Modifier and Type Method Description doublecalculate()Calculates the metric for the current state of the simulation.voidclear()Resets the metric.protected voidinitialize()Initializes all the variables needed for computing and updating the values of the metric.voidupdate(Iteration<U,I,F> iteration)Updates the different values which are necessary for computing a metric, given the information received by users in an iteration of the simulation.Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric
getName, initialize, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.relison.diffusion.metrics.SimulationMetric
calculate, initialize
-
Field Details
-
ENTROPY
private static final java.lang.String ENTROPYName fixed value.- See Also:
- Constant Field Values
-
counter
Speed value. -
sum
private double sumNumber of creators of the received tweets. -
unique
private final boolean uniqueIndicates if a piece of information is considered once (or each time it appears if false).
-
-
Constructor Details
-
CreatorGlobalEntropy
public CreatorGlobalEntropy(boolean unique)Constructor.- Parameters:
unique- true if a piece of information is considered once, false if it is considered each time it appears.
-
-
Method Details
-
clear
public void clear()Description copied from interface:SimulationMetricResets the metric. -
calculate
public double calculate()Description copied from interface:SimulationMetricCalculates the metric for the current state of the simulation.- Returns:
- the value of the metric for the current state of the simulation
-
update
Description copied from interface:SimulationMetricUpdates the different values which are necessary for computing a metric, given the information received by users in an iteration of the simulation.- Parameters:
iteration- the new iteration.
-
initialize
protected void initialize()Description copied from class:AbstractGlobalSimulationMetricInitializes all the variables needed for computing and updating the values of the metric.- Specified by:
initializein classAbstractGlobalSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F>
-