Class ExternalFeatureGlobalRate<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.features.AbstractFeatureGlobalSimulationMetric<U,I,P>
es.uam.eps.ir.relison.diffusion.metrics.features.global.AbstractExternalFeatureGlobalSimulationMetric<U,I,F>
es.uam.eps.ir.relison.diffusion.metrics.features.global.ExternalFeatureGlobalRate<U,I,F>
- Type Parameters:
U- type of the users.I- type of the information pieces.F- type of the user / information pieces features.
- All Implemented Interfaces:
GlobalSimulationMetric<U,I,F>,SimulationMetric<U,I,F>
public class ExternalFeatureGlobalRate<U extends java.io.Serializable,I extends java.io.Serializable,F> extends AbstractExternalFeatureGlobalSimulationMetric<U,I,F>
Metric that computes the rate of features received by the different users which were unknown by the receiver
(we understand as external features those information features which are not present in the information pieces
created by the users, or those user features different from the receiver's ones).
-
Field Summary
Fields Modifier and Type Field Description private doubleexternalParamsThe number of external parameters that have reached the different users.private static java.lang.StringEXTPARAMRATEName fixed value.private doubletotalParamsThe total number of external parameters that have reached the different users.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 ExternalFeatureGlobalRate(java.lang.String parameter, boolean userparam, 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.protected voidupdateInfoFeature(Iteration<U,I,F> iteration)Updates the necessary values for computing the metric (when using user parameters).protected voidupdateUserFeature(Iteration<U,I,F> iteration)Updates the necessary values for computing the metric (when using user parameters).Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.global.AbstractExternalFeatureGlobalSimulationMetric
clearOwnFeatures, computeOwnFeatures, computeOwnFeatures, computeOwnInfoFeatures, computeOwnUserFeatures, getOwnFeatures, getOwnFeatures, setOwnFeaturesMethods inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.AbstractFeatureGlobalSimulationMetric
getFeature, update, usesUserFeaturesMethods 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
-
EXTPARAMRATE
private static final java.lang.String EXTPARAMRATEName fixed value.- See Also:
- Constant Field Values
-
externalParams
private double externalParamsThe number of external parameters that have reached the different users. -
totalParams
private double totalParamsThe total number of external parameters that have reached the different users. -
unique
private final boolean uniqueIndicates if a piece of information is considered once (or each time it appears if false).
-
-
Constructor Details
-
ExternalFeatureGlobalRate
public ExternalFeatureGlobalRate(java.lang.String parameter, boolean userparam, boolean unique)Constructor.- Parameters:
userparam- true if we are using a user parameter, false if we are using an information piece parameter.parameter- the name of the parameter.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
-
updateUserFeature
Updates the necessary values for computing the metric (when using user parameters).- Specified by:
updateUserFeaturein classAbstractFeatureGlobalSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F>- Parameters:
iteration- the iteration data.
-
updateInfoFeature
Updates the necessary values for computing the metric (when using user parameters).- Specified by:
updateInfoFeaturein classAbstractFeatureGlobalSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F>- Parameters:
iteration- the iteration data.
-
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>
-