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 double
externalParams
The number of external parameters that have reached the different users.private static java.lang.String
EXTPARAMRATE
Name fixed value.private double
totalParams
The total number of external parameters that have reached the different users.private boolean
unique
Indicates 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 double
calculate()
Calculates the metric for the current state of the simulation.void
clear()
Resets the metric.protected void
initialize()
Initializes all the variables needed for computing and updating the values of the metric.protected void
updateInfoFeature(Iteration<U,I,F> iteration)
Updates the necessary values for computing the metric (when using user parameters).protected void
updateUserFeature(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, setOwnFeatures
Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.features.AbstractFeatureGlobalSimulationMetric
getFeature, update, usesUserFeatures
Methods inherited from class es.uam.eps.ir.relison.diffusion.metrics.AbstractGlobalSimulationMetric
getName, initialize, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:SimulationMetric
Resets the metric. -
calculate
public double calculate()Description copied from interface:SimulationMetric
Calculates 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:
updateUserFeature
in 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:
updateInfoFeature
in 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:AbstractGlobalSimulationMetric
Initializes all the variables needed for computing and updating the values of the metric.- Specified by:
initialize
in classAbstractGlobalSimulationMetric<U extends java.io.Serializable,I extends java.io.Serializable,F>
-